Skip to content

Commit ede6f09

Browse files
authored
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.
1 parent e12549c commit ede6f09

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/future/moves/copyreg.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
from future.utils import PY3
33

44
if PY3:
5-
from copyreg import *
5+
import copyreg, sys
6+
# A "*" import uses Python 3's copyreg.__all__ which does not include
7+
# all public names in the API surface for copyreg, this avoids that
8+
# problem by just making our module _be_ a reference to the actual module.
9+
sys.modules['future.moves.copyreg'] = copyreg
610
else:
711
__future_module__ = True
812
from copy_reg import *

0 commit comments

Comments
 (0)