mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-39465: Don't access directly _Py_Identifier members (GH-20043)
* Replace id->object with _PyUnicode_FromId(&id) * Use _Py_static_string_init(str) macro to initialize statically name_op in typeobject.c.
This commit is contained in:
parent
27c0d9b54a
commit
4804b5b3df
4 changed files with 11 additions and 11 deletions
|
@ -3814,7 +3814,7 @@ update_lines_cols(void)
|
|||
return 0;
|
||||
}
|
||||
/* PyId_LINES.object will be initialized here. */
|
||||
if (PyDict_SetItem(ModDict, PyId_LINES.object, o)) {
|
||||
if (PyDict_SetItem(ModDict, _PyUnicode_FromId(&PyId_LINES), o)) {
|
||||
Py_DECREF(m);
|
||||
Py_DECREF(o);
|
||||
return 0;
|
||||
|
@ -3830,7 +3830,7 @@ update_lines_cols(void)
|
|||
Py_DECREF(o);
|
||||
return 0;
|
||||
}
|
||||
if (PyDict_SetItem(ModDict, PyId_COLS.object, o)) {
|
||||
if (PyDict_SetItem(ModDict, _PyUnicode_FromId(&PyId_COLS), o)) {
|
||||
Py_DECREF(m);
|
||||
Py_DECREF(o);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue