Reload writable modules before running a script
@@ -78,6 +78,17 @@ if "widget" not in os.environ:
except KeyError:
pass
+ keys = list(sys.modules.keys())
+ for key in keys:
+ try:
+ mod = sys.modules[key]
+ if os.access(mod.__file__, os.W_OK):
+ del sys.modules[key]
+ except AttributeError:
+ pass
+ except TypeError:
+ pass
+
python = Python.shared
python.addScriptToList(path)
