New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"modernize" the modulefinder module #64219
Comments
The modulefinder module (Lib/modulefinder.py) provides a ModuleFinder class (plus 2 helpers) you can use to see what modules a script imports (directly or indirectly). The module's implementation is centered on the old imp.find_/load_module() API (which has been deprecated). The implementation should be refactored to reflect/make use of the newer import-related APIs. The documented API for ModuleFinder is very small. However, it has quite a few methods that are "public" in the sense that their names do not start with an underscore. This will make any kind of refactoring trickier. |
I have written a new modulefinder based on importlib. It is not a refactoring of the old one, so it is no plug-in replacement. Instead it has some new features:
It is not yet tested in the wild but I will use it for the Python3 py2exe implementation. If anyone wants to take a look the current version is here: http://code.google.com/p/ctypes-stuff/source/browse/trunk/mf/py2exe/mf3.py |
The code of Thomas has not the same API than the "modulefinder" module. If you want a patch, we need to rework the code of Thomas and provide an equivalent API with the existing one. What do you suggest? |
Fixed by #11787. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: