Utilities/ClassBrowsers/__init__.py

changeset 2997
7f0ef975da9e
parent 2965
d133c7edd88a
child 3039
8dd0165d805d
child 3057
10516539f238
equal deleted inserted replaced
2996:c6f16f1b9958 2997:7f0ef975da9e
129 name = name[:-3] 129 name = name[:-3]
130 130
131 try: 131 try:
132 return imp.find_module(name, path) 132 return imp.find_module(name, path)
133 except ImportError: 133 except ImportError:
134 if name.lower().endswith(tuple(Preferences.getPython("PythonExtensions") + \ 134 if name.lower().endswith(
135 Preferences.getPython("Python3Extensions"))) or \ 135 tuple(Preferences.getPython("PythonExtensions") +
136 isPyFile: 136 Preferences.getPython("Python3Extensions"))) or \
137 isPyFile:
137 for p in path: # search in path 138 for p in path: # search in path
138 pathname = os.path.join(p, name) 139 pathname = os.path.join(p, name)
139 if os.path.exists(pathname): 140 if os.path.exists(pathname):
140 return (open(pathname), pathname, (ext, 'r', PY_SOURCE)) 141 return (open(pathname), pathname, (ext, 'r', PY_SOURCE))
141 raise ImportError 142 raise ImportError

eric ide

mercurial