mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
bpo-46476: Simplify and fix _PyStaticCode_Dealloc (GH-30965)
This commit is contained in:
parent
247480a21c
commit
26b0482393
3 changed files with 10 additions and 7 deletions
|
@ -278,7 +278,7 @@ class Printer:
|
|||
self.write(f".co_varnames = {co_varnames},")
|
||||
self.write(f".co_cellvars = {co_cellvars},")
|
||||
self.write(f".co_freevars = {co_freevars},")
|
||||
self.deallocs.append(f"_PyStaticCode_Dealloc(&{name}, (_Py_CODEUNIT *) {removesuffix(co_code, '.ob_base.ob_base')}.ob_sval);")
|
||||
self.deallocs.append(f"_PyStaticCode_Dealloc(&{name});")
|
||||
return f"& {name}.ob_base"
|
||||
|
||||
def generate_tuple(self, name: str, t: Tuple[object, ...]) -> str:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue