File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
pymode/libs/pkg_resources Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2170,7 +2170,16 @@ def _handle_ns(packageName, path_item):
21702170 return None
21712171
21722172 if PY3 :
2173- loader = importer .find_module (packageName )
2173+ # * since python 3.3, the `imp.find_module()` is deprecated
2174+ # * `importlib.util.find_spec()` is new in python 3.4
2175+ # * in vim source, if compiled vim with python 3.7 or new, the vim
2176+ # python 3 interface will use `find_spec` instead of `find_module`
2177+ # and `load_module`. (note: this depends on the python which compiled
2178+ # with vim, not the python loaded by vim at runtime.)
2179+ try :
2180+ loader = importer .find_spec (packageName )
2181+ except AttributeError :
2182+ loader = importer .find_module (packageName )
21742183 else :
21752184 try :
21762185 loader = importer .find_module (packageName )
You can’t perform that action at this time.
0 commit comments