You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Give modulefinder some much-needed updates. #80117
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.
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!
Activity
brandtbucher commentedon Feb 8, 2019
I've written a patch here that includes a few useful fixes. Namely:
importlibinstead ofimp, 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.
brandtbucher commentedon Feb 10, 2019
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!
ncoghlan commentedon Apr 7, 2019
New changeset 9d7b2c0 by Nick Coghlan (Brandt Bucher) in branch 'master':
bpo-35936: Updates to modulefinder (GH-11787)
9d7b2c0
ncoghlan commentedon Apr 7, 2019
Thanks Brandt!
I'll also go back and close bpo-17396, bpo-35376, and bpo-25160