mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.13] gh-113993: Don't immortalize in PyUnicode_InternInPlace; keep immortalizing in other API (GH-121364) (GH-121854)
* Switch PyUnicode_InternInPlace to _PyUnicode_InternMortal, clarify docs
* Document immortality in some functions that take `const char *`
This is PyUnicode_InternFromString;
PyDict_SetItemString, PyObject_SetAttrString;
PyObject_DelAttrString; PyUnicode_InternFromString;
and the PyModule_Add convenience functions.
Always point out a non-immortalizing alternative.
* Don't immortalize user-provided attr names in _ctypes
(cherry picked from commit b4aedb23ae
)
This commit is contained in:
parent
72cd53ea15
commit
4395d68c70
6 changed files with 83 additions and 10 deletions
|
@ -15281,7 +15281,7 @@ void
|
|||
PyUnicode_InternInPlace(PyObject **p)
|
||||
{
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
_PyUnicode_InternImmortal(interp, p);
|
||||
_PyUnicode_InternMortal(interp, p);
|
||||
}
|
||||
|
||||
// Public-looking name kept for the stable ABI; user should not call this:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue