diff --git a/Lib/weakref.py b/Lib/weakref.py index 5f672c66a7a..6663c262d14 100644 --- a/Lib/weakref.py +++ b/Lib/weakref.py @@ -9,8 +9,6 @@ # they are called this instead of "ref" to avoid name collisions with # the module-global ref() function imported from _weakref. -import collections - from _weakref import ( getweakrefcount, getweakrefs, @@ -22,6 +20,8 @@ from _weakrefset import WeakSet +import collections # Import after _weakref to avoid circular import. + ProxyTypes = (ProxyType, CallableProxyType) __all__ = ["ref", "proxy", "getweakrefcount", "getweakrefs",