Brett Cannon added the comment:
Well, that's extremely annoying as that doesn't work for .py or .pyc files::
>>> import imp
>>> stuff = imp.find_module('blah')
>>> stuff
(<_io.TextIOWrapper name=4 mode='U' encoding='utf-8'>, 'blah.py', ('.py', 'U',
1))
>>> stuff[0].close()
>>> imp.load_module('blah', None, 'blah.py', stuff[2])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: file object required for import (type code 1)
I really hate these functions.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com