Ticket #14698: python_import_misses.diff
File python_import_misses.diff, 595 bytes (added by , 14 years ago) |
---|
-
django/utils/module_loading.py
diff --git a/django/utils/module_loading.py b/django/utils/module_loading.py index f251035..f5a78c6 100644
a b import sys 6 6 def module_has_submodule(package, module_name): 7 7 """See if 'module' is in 'package'.""" 8 8 name = ".".join([package.__name__, module_name]) 9 if name in sys.modules: 10 return True 9 try: 10 return sys.modules[name] is not None 11 except KeyError: 12 pass 11 13 for finder in sys.meta_path: 12 14 if finder.find_module(name): 13 15 return True