From cd84e984b7ac957a5268749397ba2cd48e0a6680 Mon Sep 17 00:00:00 2001 From: smishlayev Date: Mon, 11 Feb 2013 15:15:40 +0200 Subject: [PATCH] Update kivy/modules/__init__.py handle ImportError: try to import just by module name (in case it is user module, not kivy.modules.* one) --- kivy/modules/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kivy/modules/__init__.py b/kivy/modules/__init__.py index 1143c1f94..b13fc7521 100644 --- a/kivy/modules/__init__.py +++ b/kivy/modules/__init__.py @@ -117,8 +117,12 @@ class ModuleBase: module = __import__(name=modname) module = sys.modules[modname] except ImportError: - Logger.exception('Modules: unable to import <%s>' % name) - raise + try: + module = __import__(name=name) + module = sys.modules[name] + except ImportError: + Logger.exception('Modules: unable to import <%s>' % name) + raise # basic check on module if not hasattr(module, 'start'): Logger.warning('Modules: Module <%s> missing start() function' %