summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-05-06 21:24:14 (GMT)
committerGitHub <noreply@github.com>2024-05-06 21:24:14 (GMT)
commit2ba2c142a615abbd8138d253edfe02426c386961 (patch)
tree74ebc2335a853051acb8a544ce52b98a328686fd /Objects
parent616b745b89a52a1d27123107718f85e65918afdc (diff)
downloadcpython-2ba2c142a615abbd8138d253edfe02426c386961.zip
cpython-2ba2c142a615abbd8138d253edfe02426c386961.tar.gz
cpython-2ba2c142a615abbd8138d253edfe02426c386961.tar.bz2
gh-118527: Intern code name and filename on default build (#118576)
Interned and non-interned strings are treated differently by `marshal`, so be consistent between the default and free-threaded build.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/codeobject.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 15d3960..2ce5f7d 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -390,11 +390,9 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
co->co_filename = Py_NewRef(con->filename);
co->co_name = Py_NewRef(con->name);
co->co_qualname = Py_NewRef(con->qualname);
-#ifdef Py_GIL_DISABLED
PyUnicode_InternInPlace(&co->co_filename);
PyUnicode_InternInPlace(&co->co_name);
PyUnicode_InternInPlace(&co->co_qualname);
-#endif
co->co_flags = con->flags;
co->co_firstlineno = con->firstlineno;