MCPcopy Create free account
hub / github.com/python/cpython / setrecursionlimit

Function setrecursionlimit

Lib/idlelib/run.py:352–366  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

350
351 @functools.wraps(sys.setrecursionlimit)
352 def setrecursionlimit(*args, **kwargs):
353 # mimic the original sys.setrecursionlimit()'s input handling
354 if kwargs:
355 raise TypeError(
356 "setrecursionlimit() takes no keyword arguments")
357 try:
358 limit, = args
359 except ValueError:
360 raise TypeError(f"setrecursionlimit() takes exactly one "
361 f"argument ({len(args)} given)")
362 if not limit > 0:
363 raise ValueError(
364 "recursion limit must be greater or equal than 1")
365
366 return setrecursionlimit.__wrapped__(limit + RECURSIONLIMIT_DELTA)
367
368 fixdoc(setrecursionlimit, f"""\
369 This IDLE wrapper adds {RECURSIONLIMIT_DELTA} to prevent possible

Callers

nothing calls this directly

Calls 1

__wrapped__Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…