[issue35839] Suggestion: Ignore sys.modules entries with no __spec__ attribute in find_spec

2019-02-01 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue35839] Suggestion: Ignore sys.modules entries with no __spec__ attribute in find_spec

2019-01-27 Thread Nick Coghlan
Nick Coghlan added the comment: I'd also suggest that we emit ImportWarning when taking the fallback path, since we really would prefer that sys.modules entries either have a valid __spec__, or else explicitly set `__spec__ = None`. -- ___ Python

[issue35839] Suggestion: Ignore sys.modules entries with no __spec__ attribute in find_spec

2019-01-27 Thread Nick Coghlan
New submission from Nick Coghlan : (Alternate proposal inspired by the discussions in #35806 and #35791) Currently, a sys.modules entry with no __spec__ attribute will prevent importlib.util.find_spec() from locating the module, requiring the following workaround: def find_spec_bypassing_