Skip to content

Commit 1447af7

Browse files
mmohrhardhauntsaninjaserhiy-storchaka
authored
gh-106905: avoid incorrect SystemError about recursion depth mismatch (#106906)
* gh-106905: avoid incorrect SystemError about recursion depth mismatch * Update Misc/NEWS.d/next/Core and Builtins/2023-07-20-11-41-16.gh-issue-106905.AyZpuB.rst --------- Co-authored-by: Shantanu <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 1c7ed7e commit 1447af7

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix incorrect SystemError about AST constructor recursion depth mismatch.

Parser/asdl_c.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,7 @@ def func_end(self):
12861286
self.emit("state->recursion_depth--;", 1)
12871287
self.emit("return result;", 1)
12881288
self.emit("failed:", 0)
1289+
self.emit("state->recursion_depth--;", 1)
12891290
self.emit("Py_XDECREF(value);", 1)
12901291
self.emit("Py_XDECREF(result);", 1)
12911292
self.emit("return NULL;", 1)

Python/Python-ast.c

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)