aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-02-09 22:22:42 +0530
committerGitHub <noreply@github.com>2022-02-09 08:52:42 -0800
commitc0a5ebeb1239020f2ecc199053bb1a70d78841a1 (patch)
treed22793b254aaab45ddb161502d15796f4918f9aa /Objects/codeobject.c
parent128ab092cad984b73a117f58fa0e9b4105051a04 (diff)
downloadcpython-c0a5ebeb1239020f2ecc199053bb1a70d78841a1.tar.gz
cpython-c0a5ebeb1239020f2ecc199053bb1a70d78841a1.zip
bpo-46430: Intern strings in deep-frozen modules (GH-30683)
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index bb8ffa794a9..efb51464bd8 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -1924,3 +1924,15 @@ _PyStaticCode_Dealloc(PyCodeObject *co)
co->co_weakreflist = NULL;
}
}
+
+void
+_PyStaticCode_InternStrings(PyCodeObject *co)
+{
+ int res = intern_strings(co->co_names);
+ assert(res == 0);
+ res = intern_string_constants(co->co_consts, NULL);
+ assert(res == 0);
+ res = intern_strings(co->co_localsplusnames);
+ assert(res == 0);
+ (void)res;
+}