mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
Issue2378: pdb would delete free variables when stepping into a class statement.
The problem was introduced by r53954, the correction is to restore the symmetry between PyFrame_FastToLocals and PyFrame_LocalsToFast
This commit is contained in:
parent
90d0717163
commit
e4921fec01
3 changed files with 28 additions and 3 deletions
|
|
@ -904,9 +904,12 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear)
|
|||
if (ncells || nfreevars) {
|
||||
dict_to_map(co->co_cellvars, ncells,
|
||||
locals, fast + co->co_nlocals, 1, clear);
|
||||
dict_to_map(co->co_freevars, nfreevars,
|
||||
locals, fast + co->co_nlocals + ncells, 1,
|
||||
clear);
|
||||
/* Same test as in PyFrame_FastToLocals() above. */
|
||||
if (co->co_flags & CO_OPTIMIZED) {
|
||||
dict_to_map(co->co_freevars, nfreevars,
|
||||
locals, fast + co->co_nlocals + ncells, 1,
|
||||
clear);
|
||||
}
|
||||
}
|
||||
PyErr_Restore(error_type, error_value, error_traceback);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue