jparise / python-reloader

Dependency-based Python Module Reloader
http://www.indelible.org/ink/python-reloading/
MIT License
135 stars 27 forks source link

Fix collision with the builtins module from the future (that has no __import__ attribute #27

Closed alexei-argus closed 6 years ago

alexei-argus commented 6 years ago

I encountered a bug: in newer versions of python 2.7.x (but not all of them, for instance, not in the Anaconda bundles) you have a builtins module that doesn't include the import attribute.

I changed it to always look for the builtins module.

What do you think?

jparise commented 6 years ago

__builtins__ isn't available in Python 3. It's called builtins there, which is the original reason for that import ... except dance introduced in 774348c8.

(f6bf295 should fix the Travis failures, by the way.)

alexei-argus commented 6 years ago

I'll reopen another one with Python 3 support (won't be pretty but should work)l