[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.

2016-07-28 Thread R. David Murray
R. David Murray added the comment: Questions like this are more appropriate for the python-list mailing list, or even python-tutor. -- nosy: +r.david.murray resolution: -> not a bug status: open -> closed ___ Python tracker

[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.

2016-07-28 Thread Emanuel Barry
Emanuel Barry added the comment: Yeah, just add 'global testplugin' at the top of your function, before your import it (you'll also need a global statement if you want to delete/re-import it). You might want to take a look at importlib if you wish to dynamically load modules (especially

[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.

2016-07-28 Thread Decorater
Decorater added the comment: But* -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.

2016-07-28 Thread Decorater
Decorater added the comment: yeah I just noticed it is in sys.modules but does not get defined globally. Bug maybe there is a hack to make it global? -- resolution: not a bug -> status: closed -> open ___ Python tracker

[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.

2016-07-28 Thread Emanuel Barry
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

[issue27642] import and __import__() fails silently without a ImportError and does not add the module to the file's namespace.

2016-07-28 Thread Decorater
New submission from Decorater: So, I have some code. I tried to make a 'plugin' for my bot I made in python. However it seems to not be able to import it which it should be able to. The code I used is here: https://bpaste.net/show/e4445c47490d I dont even know why it is not addign it to the