summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Tools')
-rw-r--r--Tools/scripts/deepfreeze.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Tools/scripts/deepfreeze.py b/Tools/scripts/deepfreeze.py
index 8ea232f..cdd34dd 100644
--- a/Tools/scripts/deepfreeze.py
+++ b/Tools/scripts/deepfreeze.py
@@ -283,7 +283,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.interns.append(f"_PyStaticCode_InternStrings(&{name});")
+ self.interns.append(f"_PyStaticCode_InternStrings(&{name})")
return f"& {name}.ob_base"
def generate_tuple(self, name: str, t: Tuple[object, ...]) -> str:
@@ -450,9 +450,11 @@ def generate(args: list[str], output: TextIO) -> None:
with printer.block(f"void\n_Py_Deepfreeze_Fini(void)"):
for p in printer.deallocs:
printer.write(p)
- with printer.block(f"void\n_Py_Deepfreeze_Init(void)"):
+ with printer.block(f"int\n_Py_Deepfreeze_Init(void)"):
for p in printer.interns:
- printer.write(p)
+ with printer.block(f"if ({p} < 0)"):
+ printer.write("return -1;")
+ printer.write("return 0;")
if verbose:
print(f"Cache hits: {printer.hits}, misses: {printer.misses}")