patch to get reload to work in trunk

svn: r20774
This commit is contained in:
Tim G L Lyons 2012-12-07 18:57:54 +00:00
parent 096694439e
commit d21eae52e1

View File

@ -314,11 +314,13 @@ class BasePluginManager(object):
Reloads modules that might not be in the path.
"""
try:
if sys.version_info[0] < 3:
reload(module)
else:
import imp
imp.reload(module)
import imp
fp, pathname, description = imp.find_module(pdata.mod_name, [pdata.fpath])
try:
module = imp.load_module(pdata.mod_name, fp, pathname,description)
finally:
if fp:
fp.close()
except:
if pdata.mod_name in sys.modules:
del sys.modules[pdata.mod_name]