# -*- coding: utf-8 -*-
import sys
try:
    if sys.version_info[0] < 3:
        from __builtins__ import ReferenceError
    else:
        from builtins import ReferenceError
except (NameError, ImportError): # pragma: no cover
    from weakref import ReferenceError

__all__ = ['ReferenceError']

# -*- coding: utf-8 -*-

try:
    from __builtins__ import ReferenceError
except (NameError, ImportError): # pragma: no cover
    from weakref import ReferenceError

__all__ = ['ReferenceError']

--- 
+++ 
@@ -1,7 +1,10 @@
 # -*- coding: utf-8 -*-
-
+import sys
 try:
-    from __builtins__ import ReferenceError
+    if sys.version_info[0] < 3:
+        from __builtins__ import ReferenceError
+    else:
+        from builtins import ReferenceError
 except (NameError, ImportError): # pragma: no cover
     from weakref import ReferenceError
 
Fix a py3 bug in reference compatibility
