mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-100720: refactor calculation of number of frame slots for a code object into the new function _PyFrame_NumSlotsForCodeObject (#100722)
This commit is contained in:
parent
5fb1c08e15
commit
c31e356a10
5 changed files with 15 additions and 4 deletions
|
@ -262,6 +262,7 @@ class Printer:
|
|||
self.field(code, "co_argcount")
|
||||
self.field(code, "co_posonlyargcount")
|
||||
self.field(code, "co_kwonlyargcount")
|
||||
# The following should remain in sync with _PyFrame_NumSlotsForCodeObject
|
||||
self.write(f".co_framesize = {code.co_stacksize + len(localsplusnames)} + FRAME_SPECIALS_SIZE,")
|
||||
self.field(code, "co_stacksize")
|
||||
self.field(code, "co_firstlineno")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue