Brett Cannon <br...@python.org> added the comment:

Not sure what DirsOnSysPath is, but I have been only calling 
importlib.invalidate_caches() as needed in order to not slow down tests 
needlessly.

And as for detecting an environment change as necessary, that's essentially 
impossible since it's only needed if something changed between imports which 
would require adding a hook to notice that an import happened *and* a directory 
already covered by sys.path_importer_cache (not sys.path since that doesn't 
cover packages) changed w/o calling invalidate_caches().

----------

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

Reply via email to