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:
Victor Stinner 2020-05-12 01:43:38 +02:00 committed by GitHub
parent 27c0d9b54a
commit 4804b5b3df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View file

@ -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;