Skip to content

Commit 307a395

Browse files
committed
Set higher recusion limit (2**14)
1 parent a0d219c commit 307a395

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Release date: TBA
2020

2121
Closes PyCQA/pylint#8074
2222

23+
* Set a higher recursion limit at ``2**12``, instead of ``1000``
24+
to prevent accidental ``RecursionErrors``.
25+
2326

2427
What's New in astroid 2.13.3?
2528
=============================

astroid/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"""
3232

3333
import functools
34+
import sys
3435
import tokenize
3536
from importlib import import_module
3637

@@ -191,6 +192,9 @@
191192
):
192193
tokenize._compile = functools.lru_cache()(tokenize._compile) # type: ignore[attr-defined]
193194

195+
# Set a higher recursion limit. 10**3 is a bit low. Especially for PyPy.
196+
sys.setrecursionlimit(2**12)
197+
194198
# load brain plugins
195199
for module in BRAIN_MODULES_DIRECTORY.iterdir():
196200
if module.suffix == ".py":

0 commit comments

Comments
 (0)