[Python-Dev] importlib.find_loader (original) (raw)
Thomas Heller theller at ctypes.org
Fri Feb 1 07:56:46 CET 2013
- Previous message: [Python-Dev] importlib.find_loader
- Next message: [Python-Dev] importlib.find_loader
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 01.02.2013 01:42, schrieb Nick Coghlan:
Yep, looks like a bug in the bootstrapping, failing to set loader properly.
It also has the effect that reload does not work:
Type "help", "copyright", "credits" or "license" for more information.
import imp import math imp.reload(math) <module 'math' (built-in)> import signal imp.reload(signal) Traceback (most recent call last): File "", line 1, in File "C:\Python33-64\lib\imp.py", line 252, in reload return module.loader.load_module(name) AttributeError: 'module' object has no attribute 'loader'
However, I also think the current handling of the "no loader attribute" case is a separate bug - since we generally aim to tolerate non-modules in sys.modules (albeit somewhat grudgingly), importlib should probably be using "getattr(mod, 'loader', None)" rather than assuming the attribute will always be present.
Thomas
- Previous message: [Python-Dev] importlib.find_loader
- Next message: [Python-Dev] importlib.find_loader
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]