From a2125e09543fd08a656693096d9f04f037e10510 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Mon, 11 Feb 2013 11:43:26 +0200 Subject: [PATCH] Add some comments to make things clearer. --- openlp/core/lib/pluginmanager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index be171be21..6dba74998 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -93,9 +93,12 @@ class PluginManager(object): # import the modules log.debug(u'Importing %s from %s. Depth %d', module_name, root, this_depth) try: + # Use the "imp" library to try to get around a problem with the PyUNO library which + # monkey-patches the __import__ function to do some magic. This causes issues with our tests. + # First, try to find the module we want to import, searching the directory in ``root`` fp, path_name, description = imp.find_module(module_name, [root]) + # Then load the module (do the actual import) using the details from ``find_module()`` imp.load_module(module_name, fp, path_name, description) - #__import__(module_name, globals(), locals(), []) except ImportError, e: log.exception(u'Failed to import module %s on path %s for reason %s', module_name, path, e.args[0])