summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Noller <jnoller@gmail.com>2009-01-21 02:08:17 (GMT)
committerJesse Noller <jnoller@gmail.com>2009-01-21 02:08:17 (GMT)
commit7314b38168da53863136d1937059fc0ac4883a56 (patch)
tree9928b233df62b148bc6f06c7c32c57a4f0393b93
parente741cc607c226c76fef473bf772d42fc63269b9b (diff)
downloadcpython-7314b38168da53863136d1937059fc0ac4883a56.zip
cpython-7314b38168da53863136d1937059fc0ac4883a56.tar.gz
cpython-7314b38168da53863136d1937059fc0ac4883a56.tar.bz2
Issue 5009: multiprocessing: failure in manager._debug_info()
-rw-r--r--Lib/multiprocessing/managers.py6
-rw-r--r--Lib/test/test_multiprocessing.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index f32dab1..02e96b9 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -136,7 +136,7 @@ class Server(object):
self.listener = Listener(address=address, backlog=5)
self.address = self.listener.address
- self.id_to_obj = {0: (None, ())}
+ self.id_to_obj = {'0': (None, ())}
self.id_to_refcount = {}
self.mutex = threading.RLock()
self.stop = 0
@@ -298,7 +298,7 @@ class Server(object):
keys = self.id_to_obj.keys()
keys.sort()
for ident in keys:
- if ident != 0:
+ if ident != '0':
result.append(' %s: refcount=%s\n %s' %
(ident, self.id_to_refcount[ident],
str(self.id_to_obj[ident][0])[:75]))
@@ -310,7 +310,7 @@ class Server(object):
'''
Number of shared objects
'''
- return len(self.id_to_obj) - 1 # don't count ident=0
+ return len(self.id_to_obj) - 1 # don't count ident='0'
def shutdown(self, c):
'''
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index d4ce4fa..33debfb 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -1057,8 +1057,10 @@ class _TestZZZNumberOfObjects(BaseTestCase):
multiprocessing.active_children() # discard dead process objs
gc.collect() # do garbage collection
refs = self.manager._number_of_objects()
+ debug_info = self.manager._debug_info()
if refs != EXPECTED_NUMBER:
print self.manager._debug_info()
+ print debug_info
self.assertEqual(refs, EXPECTED_NUMBER)