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
Prior to 3.4, pkgutil.get_loader('__main__') would return None. Now it results in an ImportError. That's because it calls importlib.util.find_spec() which fails if an existing module does not have __spec__ or it is None.
Here's a patch that checks for modules that don't have __spec__ set.
The patch will fix the problem. However note that the docs and docstring imply (to me) that we should turn any ImportError coming out of the find_loader() call into returning None. Fixing that will also fix this bug, so this patch may be unnecessary.
The change is pretty minor so I went ahead and pushed it. To be honest, we should consider deprecating both get_loader and find_loader. I'm just not going to worry about it right now. :)
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: