From ede6f096dae610781e673f1fd91dd8c19c1060b4 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Thu, 16 May 2019 13:13:26 -0700 Subject: [PATCH] Make future.moves.copyreg just _be_ copyreg on PY3 The existing `from copyreg import *` is insufficient on Python 3 as `copyreg.__all__` does not include all of the public API names. --- src/future/moves/copyreg.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/future/moves/copyreg.py b/src/future/moves/copyreg.py index 21c7a42f..9d08cdc5 100644 --- a/src/future/moves/copyreg.py +++ b/src/future/moves/copyreg.py @@ -2,7 +2,11 @@ from future.utils import PY3 if PY3: - from copyreg import * + import copyreg, sys + # A "*" import uses Python 3's copyreg.__all__ which does not include + # all public names in the API surface for copyreg, this avoids that + # problem by just making our module _be_ a reference to the actual module. + sys.modules['future.moves.copyreg'] = copyreg else: __future_module__ = True from copy_reg import *