bpo-46430: Intern strings in deep-frozen modules (GH-30683)

This commit is contained in:
Kumar Aditya 2022-02-09 22:22:42 +05:30 committed by GitHub
parent 128ab092ca
commit c0a5ebeb12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 0 deletions

View file

@ -279,6 +279,7 @@ class Printer:
self.write(f".co_cellvars = {co_cellvars},")
self.write(f".co_freevars = {co_freevars},")
self.deallocs.append(f"_PyStaticCode_Dealloc(&{name});")
self.patchups.append(f"_PyStaticCode_InternStrings(&{name});")
return f"& {name}.ob_base"
def generate_tuple(self, name: str, t: Tuple[object, ...]) -> str: