Title: Give modulefinder some much-needed updates.
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, brandtbucher, brett.cannon, jvr, ncoghlan
Priority: normal Keywords: patch, patch

Created on 2019-02-08 03:13 by brandtbucher, last changed 2019-02-12 22:39 by brandtbucher.

Pull Requests
URL Status Linked Edit
PR 11787 open brandtbucher, 2019-02-08 03:23
PR 11787 open brandtbucher, 2019-02-08 03:23
Messages (2)
msg335054 - (view) Author: Brandt Bucher (brandtbucher) * Date: 2019-02-08 03:20
I've written a patch here that includes a few useful fixes. Namely:

- It doesn't crash if it encounters a syntax error. (17396)
- It doesn't report certain name collisions as bad. (35376)
- It doesn't use mutable default arguments in its initializer.
- Most importantly, it now uses `importlib` instead of `imp`, which is deprecated. (25160) As a benefit, frozen built-in modules (`zip import`, for example), are now correctly reported.

With the exception of these bug fixes, I've been very careful to preserve the original behavior, and have not changed any part of the API. This patch also includes 2 new regression tests.
msg335171 - (view) Author: Brandt Bucher (brandtbucher) * Date: 2019-02-10 19:20
Alright, I've gotten all of the tests passing for the new importlib-only implementation. I broke these modifications out into a new private function, _find_module, to make it clear that this fix is a simple drop-in replacement for imp.find_module.

Let me know if there's anything I've missed or could improve. Otherwise, I feel my work here is done!
Date User Action Args
2019-02-12 22:39:36brandtbuchersetnosy: + barry, brett.cannon, ncoghlan
2019-02-10 19:20:46brandtbuchersetmessages: + msg335171
2019-02-08 16:31:09SilentGhostsetkeywords: patch, patch
nosy: + jvr
2019-02-08 03:23:58brandtbuchersetkeywords: + patch
stage: patch review
pull_requests: + pull_request11780
2019-02-08 03:23:56brandtbuchersetkeywords: + patch
stage: (no value)
pull_requests: + pull_request11779
2019-02-08 03:20:39brandtbuchersetmessages: + msg335054
versions: + Python 3.8, - Python 3.4
2019-02-08 03:13:18brandtbuchercreate