Brandt Bucher <brandtbuc...@gmail.com> added the comment:

I'm not sure what you mean when you say "modulefinder currently will detect 
modules imported by a script dynamically by running the script"... modulefinder 
is completely static, no?

I also think that changing sys.path like this is a bad idea (I tried this in an 
earlier PR and was told to remove it and rework my solution). We lose 
thread-safety, and it has effects far outside of the scope of modulefinder 
(i.e. the hooks we call could cache it or something, and break later imports). 
If changing sys.path is the only way to accomplish this (still not exactly sure 
what), I doubt it will be accepted. It seems like this PR does a lot of 
unnecessary refactoring too, on first glance.

With that said, adding support for hooks should be fairly straightforward by 
just manually walking down sys.path/meta_path/path_hooks in _find_module... 
maybe.

----------
nosy: +brandtbucher

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

Reply via email to