diff --git a/Lib/copy.py b/Lib/copy.py index 07f1d23f295e..089d101c7ca3 100644 --- a/Lib/copy.py +++ b/Lib/copy.py @@ -51,6 +51,7 @@ class instances). import types import weakref from copyreg import dispatch_table +import builtins class Error(Exception): pass @@ -109,7 +110,7 @@ def _copy_immutable(x): if t is not None: d[t] = _copy_immutable for name in ("complex", "unicode"): - t = globals()['__builtins__'].get(name) + t = getattr(builtins, name, None) if t is not None: d[t] = _copy_immutable