[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.
Emanuel Barry
report at bugs.python.org
Thu Jul 28 08:07:24 EDT 2016
Emanuel Barry added the comment:
`import` merely adds the imported module to the current namespace which, in your code, is some local (non-global) namespace. It is successfully imported but never used, and quickly falls out of scope.
You also check for `testplugin in sys.modules`, but you want `'testplugin' in sys.modules`. Closing this as not a bug, please reopen if there's indeed a bug I didn't spot.
----------
nosy: +ebarry
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27642>
_______________________________________
More information about the Python-bugs-list
mailing list