I am interacting with a python 2.x API written in a non-OO way, it uses module-global scope for some internal state driven stuff. It\'s needed in a context where it\'s no longer
You can try by fooling sys.modules
import badmodule as badmod1 import sys del sys.modules['badmodule'] import badmodule as badmod2
If this works or not of course depends on what the bad module is doing...