diff --git a/pycodestyle.py b/pycodestyle.py index 7f00739a..4055716b 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -78,6 +78,13 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation. except ImportError: from ConfigParser import RawConfigParser +# this is a performance hack. see https://bugs.python.org/issue43014 +if ( + sys.version_info < (3, 10) and + callable(getattr(tokenize, '_compile', None)) +): # pragma: no cover (