patch to get reload to work in trunk
svn: r20774
This commit is contained in:
parent
096694439e
commit
d21eae52e1
@ -314,11 +314,13 @@ class BasePluginManager(object):
|
|||||||
Reloads modules that might not be in the path.
|
Reloads modules that might not be in the path.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if sys.version_info[0] < 3:
|
import imp
|
||||||
reload(module)
|
fp, pathname, description = imp.find_module(pdata.mod_name, [pdata.fpath])
|
||||||
else:
|
try:
|
||||||
import imp
|
module = imp.load_module(pdata.mod_name, fp, pathname,description)
|
||||||
imp.reload(module)
|
finally:
|
||||||
|
if fp:
|
||||||
|
fp.close()
|
||||||
except:
|
except:
|
||||||
if pdata.mod_name in sys.modules:
|
if pdata.mod_name in sys.modules:
|
||||||
del sys.modules[pdata.mod_name]
|
del sys.modules[pdata.mod_name]
|
||||||
|
Loading…
Reference in New Issue
Block a user