mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
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.
This commit is contained in:
parent
616b745b89
commit
2ba2c142a6
2 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue