MCPcopy Create free account
hub / github.com/ipython/ipython / is_recursion_error

Function is_recursion_error

IPython/core/ultratb.py:425–437  ·  view source on GitHub ↗
(etype, value, records)

Source from the content-addressed store, hash-verified

423 return res
424
425def is_recursion_error(etype, value, records):
426 try:
427 # RecursionError is new in Python 3.5
428 recursion_error_type = RecursionError
429 except NameError:
430 recursion_error_type = RuntimeError
431
432 # The default recursion limit is 1000, but some of that will be taken up
433 # by stack frames in IPython itself. >500 frames probably indicates
434 # a recursion error.
435 return (etype is recursion_error_type) \
436 and "recursion" in str(value).lower() \
437 and len(records) > _FRAME_RECURSION_LIMIT
438
439def find_recursion(etype, value, records):
440 """Identify the repeating stack frames from a RecursionError traceback

Callers 1

find_recursionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected