File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 2424 if sys .version_info >= (3 , 4 ):
2525 from importlib .machinery import PathFinder
2626
27+ PYTHON_SUBDIR = 'python3'
28+ else :
29+ PYTHON_SUBDIR = 'python2'
30+
2731
2832@plugin
2933class ScriptHost (object ):
@@ -236,16 +240,11 @@ def hook(path):
236240
237241def discover_runtime_directories (nvim ):
238242 rv = []
239- for path in nvim .list_runtime_paths ():
240- if not os .path .exists (path ):
243+ for rtp in nvim .list_runtime_paths ():
244+ if not os .path .exists (rtp ):
241245 continue
242- path1 = os .path .join (path , 'pythonx' )
243- if IS_PYTHON3 :
244- path2 = os .path .join (path , 'python3' )
245- else :
246- path2 = os .path .join (path , 'python2' )
247- if os .path .exists (path1 ):
248- rv .append (path1 )
249- if os .path .exists (path2 ):
250- rv .append (path2 )
246+ for subdir in ['pythonx' , PYTHON_SUBDIR ]:
247+ path = os .path .join (rtp , subdir )
248+ if os .path .exists (path ):
249+ rv .append (path )
251250 return rv
You can’t perform that action at this time.
0 commit comments