Brett Cannon added the comment:
I'm not sure why you think the example code as-is should work. The first entry
on sys.path is the current directory ('' or the absolute path, depending if you
are running from the interpreter prompt or specifying a file on the
command-line). Stripping off sys.path[0] guarantees the example code will not
work.
And as for why adding in '.' works on PyPy and not Python 3.3, it's because you
didn't call importlib.invalidate_caches() to clear out the directory
modification, so Python didn't notice that the file was added because the mtime
granularity for directories it larger than the time it took to have the import
for it_does_not_exist fail, write the impfile.py file, and to try importing
again.
----------
assignee: -> brett.cannon
resolution: -> invalid
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20321>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com