summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/util.py
diff options
context:
space:
mode:
authorJesse Noller <jnoller@gmail.com>2008-07-16 14:32:36 (GMT)
committerJesse Noller <jnoller@gmail.com>2008-07-16 14:32:36 (GMT)
commit13e9d582fd55c3f680cbe9d3d4c219722a484d92 (patch)
tree8fd06a37d7646bdb48d3699ac38d3c35d1a8857c /Lib/multiprocessing/util.py
parenta6c5dc07f46c21f3fab81ce44321239378c09548 (diff)
downloadcpython-13e9d582fd55c3f680cbe9d3d4c219722a484d92.zip
cpython-13e9d582fd55c3f680cbe9d3d4c219722a484d92.tar.gz
cpython-13e9d582fd55c3f680cbe9d3d4c219722a484d92.tar.bz2
Apply Amaury's patch to multiprocessing for issue 3125, removes the copy_reg and replaces it with ForkingPickler.register(), which should resolve the conflict with the global registry/ctypes
Diffstat (limited to 'Lib/multiprocessing/util.py')
-rw-r--r--Lib/multiprocessing/util.py33
1 files changed, 0 insertions, 33 deletions
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py
index c20a562..2768e9a 100644
--- a/Lib/multiprocessing/util.py
+++ b/Lib/multiprocessing/util.py
@@ -8,7 +8,6 @@
import itertools
import weakref
-import copy_reg
import atexit
import threading # we want threading to install it's
# cleanup function before multiprocessing does
@@ -302,35 +301,3 @@ class ForkAwareLocal(threading.local):
register_after_fork(self, lambda obj : obj.__dict__.clear())
def __reduce__(self):
return type(self), ()
-
-#
-# Try making some callable types picklable
-#
-
-def _reduce_method(m):
- if m.im_self is None:
- return getattr, (m.im_class, m.im_func.func_name)
- else:
- return getattr, (m.im_self, m.im_func.func_name)
-copy_reg.pickle(type(Finalize.__init__), _reduce_method)
-
-def _reduce_method_descriptor(m):
- return getattr, (m.__objclass__, m.__name__)
-copy_reg.pickle(type(list.append), _reduce_method_descriptor)
-copy_reg.pickle(type(int.__add__), _reduce_method_descriptor)
-
-def _reduce_builtin_function_or_method(m):
- return getattr, (m.__self__, m.__name__)
-copy_reg.pickle(type(list().append), _reduce_builtin_function_or_method)
-copy_reg.pickle(type(int().__add__), _reduce_builtin_function_or_method)
-
-try:
- from functools import partial
-except ImportError:
- pass
-else:
- def _reduce_partial(p):
- return _rebuild_partial, (p.func, p.args, p.keywords or {})
- def _rebuild_partial(func, args, keywords):
- return partial(func, *args, **keywords)
- copy_reg.pickle(partial, _reduce_partial)