comparison pyloader/loader.py @ 83:58eed691dca7

debugging
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 11 Nov 2013 19:18:58 -0800
parents 65d9a7c7ac63
children 36f5d31c3ed6
comparison
equal deleted inserted replaced
82:b57de7c38a74 83:58eed691dca7
10 10
11 __all__ = ['import_dotted_path', 'load'] 11 __all__ = ['import_dotted_path', 'load']
12 12
13 def import_dotted_path(module): 13 def import_dotted_path(module):
14 path = module.split('.') 14 path = module.split('.')
15 module = __import__(module) 15 try:
16 module = __import__(module)
17 except:
18 sys.stderr.write("pyloader: Error importing %s for dotted path %s\n" % (module, path))
19 raise
20
16 for name in path[1:]: 21 for name in path[1:]:
17 module = getattr(module, name) 22 module = getattr(module, name)
18 return module 23 return module
19 24
20 def load(string): 25 def load(string):