Do not cache Python interpreter path
This commit is contained in:
parent
2febf9bacc
commit
c14459dd58
@ -25,7 +25,6 @@ from builtins import * # noqa
|
||||
import os
|
||||
import sys
|
||||
import vim
|
||||
import functools
|
||||
import re
|
||||
|
||||
# Can't import these from setup.py because it makes nosetests go crazy.
|
||||
@ -37,19 +36,9 @@ PYTHON_BINARY_REGEX = re.compile(
|
||||
r'python((2(\.[67])?)|(3(\.[3-9])?))?(.exe)?$', re.IGNORECASE )
|
||||
|
||||
|
||||
def Memoize( obj ):
|
||||
cache = obj.cache = {}
|
||||
|
||||
@functools.wraps( obj )
|
||||
def memoizer( *args, **kwargs ):
|
||||
key = str( args ) + str( kwargs )
|
||||
if key not in cache:
|
||||
cache[ key ] = obj( *args, **kwargs )
|
||||
return cache[ key ]
|
||||
return memoizer
|
||||
|
||||
|
||||
@Memoize
|
||||
# Not caching the result of this function; users shouldn't have to restart Vim
|
||||
# after running the install script or setting the
|
||||
# `g:ycm_server_python_interpreter` option.
|
||||
def PathToPythonInterpreter():
|
||||
# Not calling the Python interpreter to check its version as it significantly
|
||||
# impacts startup time.
|
||||
|
Loading…
Reference in New Issue
Block a user