Discussion:
[Python-3000-checkins] r65830 - in python/branches/py3k: Lib/multiprocessing/dummy/__init__.py Lib/multiprocessing/managers.py Lib/multiprocessing/pool.py Lib/test/test_multiprocessing.py
benjamin.peterson
2008-08-18 18:40:09 UTC
Permalink
Author: benjamin.peterson
Date: Mon Aug 18 20:40:08 2008
New Revision: 65830

Log:
Merged revisions 65828 via svnmerge from
svn+ssh://pythondev at svn.python.org/python/trunk

........
r65828 | benjamin.peterson | 2008-08-18 13:31:58 -0500 (Mon, 18 Aug 2008) | 1 line

patch up multiprocessing until it's API can be changed too
........


Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/multiprocessing/dummy/__init__.py
python/branches/py3k/Lib/multiprocessing/managers.py
python/branches/py3k/Lib/multiprocessing/pool.py
python/branches/py3k/Lib/test/test_multiprocessing.py

Modified: python/branches/py3k/Lib/multiprocessing/dummy/__init__.py
==============================================================================
--- python/branches/py3k/Lib/multiprocessing/dummy/__init__.py (original)
+++ python/branches/py3k/Lib/multiprocessing/dummy/__init__.py Mon Aug 18 20:40:08 2008
@@ -53,12 +53,11 @@
else:
return None

-
is_alive = threading.Thread.is_alive
- get_name = threading.Thread.get_name
- set_name = threading.Thread.set_name
- is_daemon = threading.Thread.is_daemon
- set_daemon = threading.Thread.set_daemon
+ get_name = threading.Thread.getName
+ set_name = threading.Thread.setName
+ is_daemon = threading.Thread.isDaemon
+ set_daemon = threading.Thread.setDaemon

#
#

Modified: python/branches/py3k/Lib/multiprocessing/managers.py
==============================================================================
--- python/branches/py3k/Lib/multiprocessing/managers.py (original)
+++ python/branches/py3k/Lib/multiprocessing/managers.py Mon Aug 18 20:40:08 2008
@@ -160,7 +160,7 @@
except (OSError, IOError):
continue
t = threading.Thread(target=self.handle_request, args=(c,))
- t.set_daemon(True)
+ t.daemon = True
t.start()
except (KeyboardInterrupt, SystemExit):
pass

Modified: python/branches/py3k/Lib/multiprocessing/pool.py
==============================================================================
--- python/branches/py3k/Lib/multiprocessing/pool.py (original)
+++ python/branches/py3k/Lib/multiprocessing/pool.py Mon Aug 18 20:40:08 2008
@@ -99,15 +99,15 @@
args=(self._inqueue, self._outqueue, initializer, initargs)
)
self._pool.append(w)
- w.set_name(w.get_name().replace('Process', 'PoolWorker'))
- w.set_daemon(True)
+ w.name = w.get_name().replace('Process', 'PoolWorker')
+ w.daemon = True
w.start()

self._task_handler = threading.Thread(
target=Pool._handle_tasks,
args=(self._taskqueue, self._quick_put, self._outqueue, self._pool)
)
- self._task_handler.set_daemon(True)
+ self._task_handler.daemon = True
self._task_handler._state = RUN
self._task_handler.start()

@@ -115,7 +115,7 @@
target=Pool._handle_results,
args=(self._outqueue, self._quick_get, self._cache)
)
- self._result_handler.set_daemon(True)
+ self._result_handler.daemon = True
self._result_handler._state = RUN
self._result_handler.start()


Modified: python/branches/py3k/Lib/test/test_multiprocessing.py
==============================================================================
--- python/branches/py3k/Lib/test/test_multiprocessing.py (original)
+++ python/branches/py3k/Lib/test/test_multiprocessing.py Mon Aug 18 20:40:08 2008
@@ -620,11 +620,17 @@
woken = self.Semaphore(0)

p = self.Process(target=self.f, args=(cond, sleeping, woken))
- p.set_daemon(True)
+ try:
+ p.set_daemon(True)
+ except AttributeError:
+ p.daemon = True
p.start()

p = threading.Thread(target=self.f, args=(cond, sleeping, woken))
- p.set_daemon(True)
+ try:
+ p.set_daemon(True)
+ except AttributeError:
+ p.daemon = True
p.start()

# wait for both children to start sleeping

Loading...