Skip to content

Commit df57cf2

Browse files
committed
Use also _Py_ID() in _PySys_UpdateConfig()
Update also outdated comment.
1 parent 770d385 commit df57cf2

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

Python/sysmodule.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4060,7 +4060,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
40604060
/* implementation */
40614061
SET_SYS("implementation", make_impl_info(version_info));
40624062

4063-
// sys.flags: updated in-place later by _PySys_UpdateConfig()
4063+
// sys.flags: updated later by _PySys_UpdateConfig()
40644064
ENSURE_INFO_TYPE(FlagsType, flags_desc);
40654065
SET_SYS("flags", make_flags(tstate->interp));
40664066

@@ -4190,14 +4190,8 @@ _PySys_UpdateConfig(PyThreadState *tstate)
41904190
return -1;
41914191
}
41924192

4193-
PyObject *flags_str = PyUnicode_FromString("flags");
4194-
if (flags_str == NULL) {
4195-
Py_DECREF(new_flags);
4196-
return -1;
4197-
}
4198-
res = _PySys_SetAttr(flags_str, new_flags);
4193+
res = _PySys_SetAttr(&_Py_ID(flags), new_flags);
41994194
Py_DECREF(new_flags);
4200-
Py_DECREF(flags_str);
42014195
if (res < 0) {
42024196
return -1;
42034197
}

0 commit comments

Comments
 (0)