Update kivy/modules/__init__.py

handle ImportError: try to import just by module name (in case it is user module, not kivy.modules.* one)
This commit is contained in:
smishlayev 2013-02-11 15:15:40 +02:00
parent aad04cec86
commit cd84e984b7
1 changed files with 6 additions and 2 deletions

View File

@ -116,6 +116,10 @@ class ModuleBase:
modname = 'kivy.modules.{0}'.format(name)
module = __import__(name=modname)
module = sys.modules[modname]
except ImportError:
try:
module = __import__(name=name)
module = sys.modules[name]
except ImportError:
Logger.exception('Modules: unable to import <%s>' % name)
raise