From c14459dd58ebcb7842f89ea07d653d95acf07dfe Mon Sep 17 00:00:00 2001 From: micbou Date: Mon, 7 Nov 2016 16:36:38 +0100 Subject: [PATCH] Do not cache Python interpreter path --- python/ycm/paths.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/python/ycm/paths.py b/python/ycm/paths.py index cd0adf29..524a23f4 100644 --- a/python/ycm/paths.py +++ b/python/ycm/paths.py @@ -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.