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 |