mercurial/extensions.py
changeset 8964 119d1f664eae
parent 8896 b793ce68f082
child 9020 609b803dd252
equal deleted inserted replaced
8963:a4ceae3aa7be 8964:119d1f664eae
   123     returns a dict of {name: desc}, and the max name length'''
   123     returns a dict of {name: desc}, and the max name length'''
   124 
   124 
   125     import hgext
   125     import hgext
   126     extpath = os.path.dirname(os.path.abspath(hgext.__file__))
   126     extpath = os.path.dirname(os.path.abspath(hgext.__file__))
   127 
   127 
       
   128     try: # might not be a filesystem path
       
   129         files = os.listdir(extpath)
       
   130     except OSError:
       
   131         return None, 0
       
   132 
   128     exts = {}
   133     exts = {}
   129     maxlength = 0
   134     maxlength = 0
   130     for e in os.listdir(extpath):
   135     for e in files:
   131 
   136 
   132         if e.endswith('.py'):
   137         if e.endswith('.py'):
   133             name = e.rsplit('.', 1)[0]
   138             name = e.rsplit('.', 1)[0]
   134             path = os.path.join(extpath, e)
   139             path = os.path.join(extpath, e)
   135         else:
   140         else: