mercurial/extensions.py
changeset 17217 1b2b727a885f
parent 16709 9eca39a91964
child 18629 013fcd112f13
equal deleted inserted replaced
17216:01c1ee4bd1dd 17217:1b2b727a885f
    40         # module/__init__.py style
    40         # module/__init__.py style
    41         d, f = os.path.split(path.rstrip('/'))
    41         d, f = os.path.split(path.rstrip('/'))
    42         fd, fpath, desc = imp.find_module(f, [d])
    42         fd, fpath, desc = imp.find_module(f, [d])
    43         return imp.load_module(module_name, fd, fpath, desc)
    43         return imp.load_module(module_name, fd, fpath, desc)
    44     else:
    44     else:
    45         return imp.load_source(module_name, path)
    45         try:
       
    46             return imp.load_source(module_name, path)
       
    47         except IOError, exc:
       
    48             if not exc.filename:
       
    49                 exc.filename = path # python does not fill this
       
    50             raise
    46 
    51 
    47 def load(ui, name, path):
    52 def load(ui, name, path):
    48     # unused ui argument kept for backwards compatibility
    53     # unused ui argument kept for backwards compatibility
    49     if name.startswith('hgext.') or name.startswith('hgext/'):
    54     if name.startswith('hgext.') or name.startswith('hgext/'):
    50         shortname = name[6:]
    55         shortname = name[6:]