functools.lru_cache does not exist on Python 2, apply for Python 3 only

This commit is contained in:
Bruno Oliveira 2018-10-24 18:59:54 -03:00
parent d40cd3ec6b
commit 1786ad16a7
1 changed files with 4 additions and 1 deletions

View File

@ -894,7 +894,6 @@ class Config(object):
assert type is None
return value
@functools.lru_cache(maxsize=None)
def _getconftest_pathlist(self, name, path):
try:
mod, relroots = self.pluginmanager._rget_with_confmod(name, path)
@ -909,6 +908,10 @@ class Config(object):
values.append(relroot)
return values
if six.PY3:
# once we drop Python 2, please change this to use the normal decorator syntax (#4227)
_getconftest_pathlist = functools.lru_cache(maxsize=None)(_getconftest_pathlist)
def _get_override_ini_value(self, name):
value = None
# override_ini is a list of "ini=value" options