mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
no-issue: Add assertion to PyModule_GetName for understanding (GH-32236)
This commit is contained in:
parent
082d3495d0
commit
b183f48649
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue