mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
gh-86493: Use PyModule_Add() instead of PyModule_AddObjectRef() (GH-106860)
This commit is contained in:
parent
40f3f11a77
commit
a293fa5915
14 changed files with 26 additions and 116 deletions
|
@ -3844,14 +3844,9 @@ imp_module_exec(PyObject *module)
|
|||
{
|
||||
const wchar_t *mode = _Py_GetConfig()->check_hash_pycs_mode;
|
||||
PyObject *pyc_mode = PyUnicode_FromWideChar(mode, -1);
|
||||
if (pyc_mode == NULL) {
|
||||
if (PyModule_Add(module, "check_hash_based_pycs", pyc_mode) < 0) {
|
||||
return -1;
|
||||
}
|
||||
if (PyModule_AddObjectRef(module, "check_hash_based_pycs", pyc_mode) < 0) {
|
||||
Py_DECREF(pyc_mode);
|
||||
return -1;
|
||||
}
|
||||
Py_DECREF(pyc_mode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue