Skip to content

Commit 6725fb2

Browse files
committed
handle curframe_locals deprecation in 3.14
- python/cpython#124369 - python/cpython#125951
1 parent 5280715 commit 6725fb2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/pdbpp.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,20 @@ def prompt(self, value):
365365
value = "{}++{}".format(*m.groups(""))
366366
self._pdbpp_prompt = value
367367

368+
@property
369+
def curframe_locals(self):
370+
if sys.version_info >= (3, 14):
371+
return self.curframe.f_locals
372+
373+
return super().curframe_locals
374+
375+
@curframe_locals.setter
376+
def curframe_locals(self, value):
377+
if sys.version_info >= (3, 14):
378+
self.curframe.f_locals = value
379+
else:
380+
self.curframe_locals = value
381+
368382
def _setup_streams(self, stdout):
369383
self.stdout = self.ensure_file_can_write_unicode(stdout)
370384

0 commit comments

Comments
 (0)