summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/util.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-08-19 21:30:55 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-08-19 21:30:55 (GMT)
commit949d47dc7adc464c0c70b258a02b89fd67791c1a (patch)
tree7b1528484d3eb3defb05b9f7abab77e06f762951 /Lib/multiprocessing/util.py
parent3ad89100c1479a953ec10264d9aa1b13df1e59cb (diff)
downloadcpython-949d47dc7adc464c0c70b258a02b89fd67791c1a.zip
cpython-949d47dc7adc464c0c70b258a02b89fd67791c1a.tar.gz
cpython-949d47dc7adc464c0c70b258a02b89fd67791c1a.tar.bz2
Issue #3125: Remove copy_reg in multiprocessing and replace it with
ForkingPickler.register() to resolve conflict with 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 aae38c7..3fe0175 100644
--- a/Lib/multiprocessing/util.py
+++ b/Lib/multiprocessing/util.py
@@ -8,7 +8,6 @@
import itertools
import weakref
-import copyreg
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.__self__ is None:
- return getattr, (m.__self__.__class__, m.__func__.__name__)
- else:
- return getattr, (m.__self__, m.__func__.__name__)
-copyreg.pickle(type(Finalize.__init__), _reduce_method)
-
-def _reduce_method_descriptor(m):
- return getattr, (m.__objclass__, m.__name__)
-copyreg.pickle(type(list.append), _reduce_method_descriptor)
-copyreg.pickle(type(int.__add__), _reduce_method_descriptor)
-
-def _reduce_builtin_function_or_method(m):
- return getattr, (m.__self__, m.__name__)
-copyreg.pickle(type(list().append), _reduce_builtin_function_or_method)
-copyreg.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)
- copyreg.pickle(partial, _reduce_partial)