Merge pull request #4227 from blueyed/_getconftest_pathlist-lru
Use functools.lru_cache with _getconftest_pathlist
This commit is contained in:
commit
65b97c2f41
|
@ -1,6 +1,7 @@
|
||||||
""" command line options, ini-file and conftest.py processing. """
|
""" command line options, ini-file and conftest.py processing. """
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
import argparse
|
import argparse
|
||||||
|
import functools
|
||||||
import inspect
|
import inspect
|
||||||
import shlex
|
import shlex
|
||||||
import types
|
import types
|
||||||
|
@ -907,6 +908,10 @@ class Config(object):
|
||||||
values.append(relroot)
|
values.append(relroot)
|
||||||
return values
|
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):
|
def _get_override_ini_value(self, name):
|
||||||
value = None
|
value = None
|
||||||
# override_ini is a list of "ini=value" options
|
# override_ini is a list of "ini=value" options
|
||||||
|
|
Loading…
Reference in New Issue