diff options
author | shadchin <shadchin@yandex-team.com> | 2024-10-27 10:52:33 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2024-10-27 11:03:47 +0300 |
commit | 1529383373617c6d14ad4972afdc46a5eb35f954 (patch) | |
tree | 229b7647fafadd4ee4b93d20e606c534ad697365 /contrib/tools/python3/Python/codecs.c | |
parent | 41d598c624442bf6918407466dac3316b8277347 (diff) | |
download | ydb-1529383373617c6d14ad4972afdc46a5eb35f954.tar.gz |
Update Python 3 to 3.12.7
commit_hash:052a122399d67f1ea5dfbc5f6457e3e06200becf
Diffstat (limited to 'contrib/tools/python3/Python/codecs.c')
-rw-r--r-- | contrib/tools/python3/Python/codecs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/tools/python3/Python/codecs.c b/contrib/tools/python3/Python/codecs.c index 1983f56ba2..b041339e0d 100644 --- a/contrib/tools/python3/Python/codecs.c +++ b/contrib/tools/python3/Python/codecs.c @@ -144,7 +144,9 @@ PyObject *_PyCodec_Lookup(const char *encoding) if (v == NULL) { return NULL; } - PyUnicode_InternInPlace(&v); + + /* Intern the string. We'll make it immortal later if lookup succeeds. */ + _PyUnicode_InternMortal(interp, &v); /* First, try to lookup the name in the registry dictionary */ PyObject *result = PyDict_GetItemWithError(interp->codec_search_cache, v); @@ -197,6 +199,8 @@ PyObject *_PyCodec_Lookup(const char *encoding) goto onError; } + _PyUnicode_InternImmortal(interp, &v); + /* Cache and return the result */ if (PyDict_SetItem(interp->codec_search_cache, v, result) < 0) { Py_DECREF(result); |