Skip to content

Commit a822705

Browse files
mmohrhardhauntsaninjaserhiy-storchaka
authored andcommitted
gh-106905: avoid incorrect SystemError about recursion depth mismatch (GH-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 --------- (cherry picked from commit 1447af7) Co-authored-by: Markus Mohrhard <markusm@dug.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent a1447af commit a822705

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
@@ -1283,6 +1283,7 @@ def func_end(self):
12831283
self.emit("state->recursion_depth--;", 1)
12841284
self.emit("return result;", 1)
12851285
self.emit("failed:", 0)
1286+
self.emit("state->recursion_depth--;", 1)
12861287
self.emit("Py_XDECREF(value);", 1)
12871288
self.emit("Py_XDECREF(result);", 1)
12881289
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)