[3.12] gh-58956: Fix a frame refleak in bdb (GH-128190) (#128953)

* [3.12] gh-58956: Fix a frame refleak in bdb (GH-128190)
(cherry picked from commit 767c89ba7c)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
This commit is contained in:
Tian Gao 2025-01-17 14:19:37 -05:00 committed by GitHub
parent dfd75dfeed
commit f45da82c11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 56 additions and 0 deletions

View file

@ -281,6 +281,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
if hasattr(self, 'curframe') and self.curframe:
self.curframe.f_globals.pop('__pdb_convenience_variables', None)
self.curframe = None
self.curframe_locals = {}
self.tb_lineno.clear()
def setup(self, f, tb):