diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-08-19 21:30:55 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-08-19 21:30:55 (GMT) |
commit | 949d47dc7adc464c0c70b258a02b89fd67791c1a (patch) | |
tree | 7b1528484d3eb3defb05b9f7abab77e06f762951 /Lib/multiprocessing/managers.py | |
parent | 3ad89100c1479a953ec10264d9aa1b13df1e59cb (diff) | |
download | cpython-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/managers.py')
-rw-r--r-- | Lib/multiprocessing/managers.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index d6b16e5..d1522c2 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -18,13 +18,12 @@ import sys import weakref import threading import array -import copyreg import queue from traceback import format_exc from multiprocessing import Process, current_process, active_children, Pool, util, connection from multiprocessing.process import AuthenticationString -from multiprocessing.forking import exit, Popen, assert_spawning +from multiprocessing.forking import exit, Popen, assert_spawning, ForkingPickler from multiprocessing.util import Finalize, info try: @@ -38,14 +37,14 @@ except ImportError: def reduce_array(a): return array.array, (a.typecode, a.tostring()) -copyreg.pickle(array.array, reduce_array) +ForkingPickler.register(array.array, reduce_array) view_types = [type(getattr({}, name)()) for name in ('items','keys','values')] if view_types[0] is not list: # only needed in Py3.0 def rebuild_as_list(obj): return list, (list(obj),) for view_type in view_types: - copyreg.pickle(view_type, rebuild_as_list) + ForkingPickler.register(view_type, rebuild_as_list) # # Type for identifying shared objects |