[3.14] gh-148208: Fix recursion depth leak in PyObject_Print (GH-148209) (#148412)

gh-148208: Fix recursion depth leak in `PyObject_Print` (GH-148209)
(cherry picked from commit e2fa10e04d)

Co-authored-by: Wulian233 <1055917385@qq.com>
This commit is contained in:
Miss Islington (bot) 2026-04-12 02:52:21 +02:00 committed by GitHub
parent a4f9bbf5b8
commit a9d122fb05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1 @@
Fix recursion depth leak in :c:func:`PyObject_Print`

View file

@ -686,6 +686,8 @@ PyObject_Print(PyObject *op, FILE *fp, int flags)
ret = -1;
}
}
_Py_LeaveRecursiveCall();
return ret;
}