mirror of
https://github.com/python/cpython.git
synced 2024-11-27 03:45:08 +08:00
no-issue: Add assertion to PyModule_GetName for understanding (GH-32236)
This commit is contained in:
parent
082d3495d0
commit
b183f48649
@ -510,8 +510,10 @@ const char *
|
||||
PyModule_GetName(PyObject *m)
|
||||
{
|
||||
PyObject *name = PyModule_GetNameObject(m);
|
||||
if (name == NULL)
|
||||
if (name == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
assert(Py_REFCNT(name) >= 2);
|
||||
Py_DECREF(name); /* module dict has still a reference */
|
||||
return PyUnicode_AsUTF8(name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user