bpo-47084: Clear Unicode cached representations on finalization (GH-32032)

This commit is contained in:
Jeremy Kloth 2022-03-22 06:53:51 -06:00 committed by GitHub
parent 7d810b6a4e
commit 88872a29f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 18 deletions

View file

@ -185,6 +185,7 @@ class Printer:
else:
self.write("PyCompactUnicodeObject _compact;")
self.write(f"{datatype} _data[{len(s)+1}];")
self.deallocs.append(f"_PyStaticUnicode_Dealloc((PyObject *)&{name});")
with self.block(f"{name} =", ";"):
if ascii:
with self.block("._ascii =", ","):