@@ -198,6 +198,7 @@ def serve_initialize(self, request: dict):
198
198
self .source_dirs .add (self .root_path )
199
199
200
200
self ._load_config_file ()
201
+ update_recursion_limit (self .recursion_limit )
201
202
self ._resolve_globs_in_paths ()
202
203
self ._config_logger (request )
203
204
self ._load_intrinsics ()
@@ -1593,6 +1594,7 @@ def _load_config_file_general(self, config_dict: dict) -> None:
1593
1594
"incremental_sync" , self .incremental_sync
1594
1595
)
1595
1596
self .sync_type : int = 2 if self .incremental_sync else 1
1597
+ self .recursion_limit = config_dict .get ("recursion_limit" , self .recursion_limit )
1596
1598
self .sort_keywords = config_dict .get ("sort_keywords" , self .sort_keywords )
1597
1599
self .disable_autoupdate = config_dict .get (
1598
1600
"disable_autoupdate" , self .disable_autoupdate
@@ -1826,6 +1828,18 @@ def _update_version_pypi(self, test: bool = False):
1826
1828
return False
1827
1829
1828
1830
1831
+ def update_recursion_limit (limit : int ) -> None :
1832
+ """Update the recursion limit of the Python interpreter
1833
+
1834
+ Parameters
1835
+ ----------
1836
+ limit : int
1837
+ New recursion limit
1838
+ """
1839
+ if limit != sys .getrecursionlimit ():
1840
+ sys .setrecursionlimit (limit )
1841
+
1842
+
1829
1843
class JSONRPC2Error (Exception ):
1830
1844
def __init__ (self , code , message , data = None ):
1831
1845
self .code = code
0 commit comments