]> granicus.if.org Git - python/commitdiff
merge r68839 forward to py3k
authorJesse Noller <jnoller@gmail.com>
Wed, 21 Jan 2009 02:15:48 +0000 (02:15 +0000)
committerJesse Noller <jnoller@gmail.com>
Wed, 21 Jan 2009 02:15:48 +0000 (02:15 +0000)
Lib/multiprocessing/managers.py
Lib/test/test_multiprocessing.py

index 78c1fe715643e5e1152217b99a9a6101fcbc2c4f..cb102e50fb5a063df39d293106739516898e6230 100644 (file)
@@ -139,7 +139,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
@@ -301,7 +301,7 @@ class Server(object):
             keys = list(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]))
@@ -313,7 +313,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):
         '''
index 9a307dee7ac0a3cca63658243782a3721c65c907..3681c60d50d0c8677fa95b37a0e1adea6e27ad0a 100644 (file)
@@ -1058,8 +1058,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)