Adding our paths to sys.path start, not end
Otherwise things can conflict and we could end up loading the wrong module.
This commit is contained in:
parent
c67658bbce
commit
f671fe72b2
@ -75,9 +75,9 @@ class Flags( object ):
|
|||||||
flags_module = self.flags_module_for_flags_module_file[
|
flags_module = self.flags_module_for_flags_module_file[
|
||||||
flags_module_file ]
|
flags_module_file ]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
sys.path.append( _DirectoryOfThisScript() )
|
sys.path.insert( 0, _DirectoryOfThisScript() )
|
||||||
flags_module = imp.load_source( _RandomName(), flags_module_file )
|
flags_module = imp.load_source( _RandomName(), flags_module_file )
|
||||||
del sys.path[ -1 ]
|
del sys.path[ 0 ]
|
||||||
|
|
||||||
self.flags_module_for_flags_module_file[
|
self.flags_module_for_flags_module_file[
|
||||||
flags_module_file ] = flags_module
|
flags_module_file ] = flags_module
|
||||||
|
@ -73,9 +73,9 @@ class YouCompleteMe( object ):
|
|||||||
supported_filetypes = [ filetype ]
|
supported_filetypes = [ filetype ]
|
||||||
if os.path.exists( module_path ):
|
if os.path.exists( module_path ):
|
||||||
|
|
||||||
sys.path.append( os.path.dirname( module_path ) )
|
sys.path.insert( 0, os.path.dirname( module_path ) )
|
||||||
module = imp.load_source( filetype, module_path )
|
module = imp.load_source( filetype, module_path )
|
||||||
del sys.path[ -1 ]
|
del sys.path[ 0 ]
|
||||||
|
|
||||||
completer = module.GetCompleter()
|
completer = module.GetCompleter()
|
||||||
if completer:
|
if completer:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user