Eric Snow added the comment:

The FileFinder class (a "path entry finder") uses a cache to efficiently track 
changes to files.  You can manually clear this cache by calling 
importlib.invalidate_caches().  The Python test suite has several examples of 
clearing the FileFinder cache in this way.

I've verified the failure as described.  Using importlib.invalidate_caches() at 
the spot where the script cleans up sys.modules, the failure goes away.

Depending on OS filesystem timestamp resolution, you could see the behavior 
just as you've described it.  Since normally you wouldn't remove and re-add 
modules like this, it isn't normally an issue.

----------
nosy: +eric.snow
stage:  -> test needed
type:  -> behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15912>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to