summaryrefslogtreecommitdiff
path: root/Tools/build/generate_global_objects.py
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2023-03-14 15:21:38 +0530
committerGitHub <noreply@github.com>2023-03-14 15:21:38 +0530
commita703f743dbf2675948e59c44fa9d7112f7825100 (patch)
tree9ba3214d6149aea9ccd28a8c2eee86b97cd1d390 /Tools/build/generate_global_objects.py
parent88c262c086077377b40dfae5e46f597e28ffe3c9 (diff)
downloadcpython-git-a703f743dbf2675948e59c44fa9d7112f7825100.tar.gz
GH-94851: check unicode consistency of static strings in debug mode (#102684)
Diffstat (limited to 'Tools/build/generate_global_objects.py')
-rw-r--r--Tools/build/generate_global_objects.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Tools/build/generate_global_objects.py b/Tools/build/generate_global_objects.py
index 9ceae89878..1f53f02d41 100644
--- a/Tools/build/generate_global_objects.py
+++ b/Tools/build/generate_global_objects.py
@@ -360,6 +360,7 @@ def generate_static_strings_initializer(identifiers, strings):
# This use of _Py_ID() is ignored by iter_global_strings()
# since iter_files() ignores .h files.
printer.write(f'string = &_Py_ID({i});')
+ printer.write(f'assert(_PyUnicode_CheckConsistency(string, 1));')
printer.write(f'PyUnicode_InternInPlace(&string);')
# XXX What about "strings"?
printer.write(END)