summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2013-09-29 16:33:04 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2013-09-29 16:33:04 (GMT)
commit085ab4a553e1ff3f32a091850bd8acb02eee63ec (patch)
treee250c5f135fd1d0859e9aabb35180cdca145e242
parent84c1205043684542e83e653cbc3863e4d7d9a241 (diff)
parent8b3f5aafd3e04e22dec6740b790ea1dbdc361768 (diff)
downloadcpython-085ab4a553e1ff3f32a091850bd8acb02eee63ec.zip
cpython-085ab4a553e1ff3f32a091850bd8acb02eee63ec.tar.gz
cpython-085ab4a553e1ff3f32a091850bd8acb02eee63ec.tar.bz2
Merge.
-rw-r--r--Lib/test/_test_multiprocessing.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index c0cc1a9..de0c968 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -3038,12 +3038,19 @@ class TestInitializers(unittest.TestCase):
# Verifies os.close(sys.stdin.fileno) vs. sys.stdin.close() behavior
#
-def _ThisSubProcess(q):
+def _this_sub_process(q):
try:
item = q.get(block=False)
except pyqueue.Empty:
pass
+def _test_process(q):
+ queue = multiprocessing.Queue()
+ subProc = multiprocessing.Process(target=_this_sub_process, args=(queue,))
+ subProc.daemon = True
+ subProc.start()
+ subProc.join()
+
def _afunc(x):
return x*x
@@ -3077,14 +3084,8 @@ class _file_like(object):
class TestStdinBadfiledescriptor(unittest.TestCase):
def test_queue_in_process(self):
- def _TestProcess(q):
- queue = multiprocessing.Queue()
- subProc = multiprocessing.Process(target=_ThisSubProcess, args=(queue,))
- subProc.daemon = True
- subProc.start()
- subProc.join()
queue = multiprocessing.Queue()
- proc = multiprocessing.Process(target=_TestProcess, args=(queue,))
+ proc = multiprocessing.Process(target=_test_process, args=(queue,))
proc.start()
proc.join()