summaryrefslogtreecommitdiff
path: root/pycodestyle.py
diff options
context:
space:
mode:
Diffstat (limited to 'pycodestyle.py')
-rwxr-xr-xpycodestyle.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index 7f00739..4055716 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -78,6 +78,13 @@ try:
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 (<py310)
+ tokenize._compile = lru_cache()(tokenize._compile) # type: ignore
+
__version__ = '2.7.0'
DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__,.tox'