From d21eae52e13bbf4850094ff29d06ead24017b17c Mon Sep 17 00:00:00 2001 From: Tim G L Lyons Date: Fri, 7 Dec 2012 18:57:54 +0000 Subject: [PATCH] patch to get reload to work in trunk svn: r20774 --- gramps/gen/plug/_manager.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gramps/gen/plug/_manager.py b/gramps/gen/plug/_manager.py index f97f816db..60fcccac7 100644 --- a/gramps/gen/plug/_manager.py +++ b/gramps/gen/plug/_manager.py @@ -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]