From 4978546e62326e2e2dd0573528eb253b849f4093 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sun, 19 May 2013 10:34:44 -0700 Subject: [PATCH] Refactoring out some pointless sys.path changes --- python/completers/cpp/hook.py | 2 +- python/completers/general/general_completer_store.py | 4 ++-- python/completers/python/hook.py | 2 +- python/ycm.py | 5 ----- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/python/completers/cpp/hook.py b/python/completers/cpp/hook.py index 32019761..c60f3956 100644 --- a/python/completers/cpp/hook.py +++ b/python/completers/cpp/hook.py @@ -18,7 +18,7 @@ # along with YouCompleteMe. If not, see . import ycm_core -from clang_completer import ClangCompleter +from completers.cpp.clang_completer import ClangCompleter def GetCompleter(): if ycm_core.HasClangSupport(): diff --git a/python/completers/general/general_completer_store.py b/python/completers/general/general_completer_store.py index badfa9fb..746f0b12 100644 --- a/python/completers/general/general_completer_store.py +++ b/python/completers/general/general_completer_store.py @@ -20,10 +20,10 @@ from completers.completer import Completer from completers.all.identifier_completer import IdentifierCompleter -from filename_completer import FilenameCompleter +from completers.general.filename_completer import FilenameCompleter try: - from ultisnips_completer import UltiSnipsCompleter + from completers.general.ultisnips_completer import UltiSnipsCompleter USE_ULTISNIPS_COMPLETER = True except ImportError: USE_ULTISNIPS_COMPLETER = False diff --git a/python/completers/python/hook.py b/python/completers/python/hook.py index 1743b733..fdf611da 100644 --- a/python/completers/python/hook.py +++ b/python/completers/python/hook.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with YouCompleteMe. If not, see . -from jedi_completer import JediCompleter +from completers.python.jedi_completer import JediCompleter def GetCompleter(): return JediCompleter() diff --git a/python/ycm.py b/python/ycm.py index 74ba797a..b46c1ee7 100644 --- a/python/ycm.py +++ b/python/ycm.py @@ -19,7 +19,6 @@ import imp import os -import sys import vimsupport import vim import ycm_utils as utils @@ -85,11 +84,7 @@ class YouCompleteMe( object ): completer = None supported_filetypes = [ filetype ] if os.path.exists( module_path ): - - sys.path.insert( 0, os.path.dirname( module_path ) ) module = imp.load_source( filetype, module_path ) - del sys.path[ 0 ] - completer = module.GetCompleter() if completer: supported_filetypes.extend( completer.SupportedFiletypes() )