mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Provide curframe_locals for backward compatibility but deprecate it (#125951)
This commit is contained in:
parent
c1f352bf08
commit
29f8a67ae0
4 changed files with 21 additions and 1 deletions
11
Lib/pdb.py
11
Lib/pdb.py
|
@ -90,6 +90,7 @@ import _colorize
|
|||
from contextlib import contextmanager
|
||||
from rlcompleter import Completer
|
||||
from types import CodeType
|
||||
from warnings import deprecated
|
||||
|
||||
|
||||
class Restart(Exception):
|
||||
|
@ -421,6 +422,16 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
|||
]
|
||||
self.rcLines = []
|
||||
|
||||
@property
|
||||
@deprecated("The frame locals reference is no longer cached. Use 'curframe.f_locals' instead.")
|
||||
def curframe_locals(self):
|
||||
return self.curframe.f_locals
|
||||
|
||||
@curframe_locals.setter
|
||||
@deprecated("Setting 'curframe_locals' no longer has any effect. Update the contents of 'curframe.f_locals' instead.")
|
||||
def curframe_locals(self, value):
|
||||
pass
|
||||
|
||||
# Override Bdb methods
|
||||
|
||||
def user_call(self, frame, argument_list):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue