summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer McIntyre <zeroSteiner@gmail.com>2016-04-21 13:44:55 -0400
committerSpencer McIntyre <zeroSteiner@gmail.com>2016-04-21 13:44:55 -0400
commite6c1df55f7cbe8c861be5e2ae262ad98e6090fd1 (patch)
tree127142438b026e7bd92ac2ccf1da3564d27a882b
parent4eb4bbe214bd9650fd20cbf3672cdb9765762982 (diff)
downloadpluginbase-e6c1df55f7cbe8c861be5e2ae262ad98e6090fd1.tar.gz
Fix #6, check key exists before removing
-rw-r--r--pluginbase.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pluginbase.py b/pluginbase.py
index 1158ed9..c75d3bc 100644
--- a/pluginbase.py
+++ b/pluginbase.py
@@ -316,7 +316,9 @@ class PluginSource(object):
except AttributeError:
pass
prefix = modname + '.'
- _sys.modules.pop(modname)
+ # avoid the bug described in issue #6
+ if modname in _sys.modules:
+ del _sys.modules[modname]
for key, value in list(_sys.modules.items()):
if not key.startswith(prefix):
continue