mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Add a new warning gategory, ResourceWarning, as discussed on python-dev. It is silent by default,
except when configured --with-pydebug. Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
This commit is contained in:
parent
872a702bbd
commit
08be72d0aa
12 changed files with 80 additions and 30 deletions
|
@ -767,8 +767,10 @@ PyErr_WriteUnraisable(PyObject *obj)
|
|||
}
|
||||
Py_XDECREF(moduleName);
|
||||
}
|
||||
PyFile_WriteString(" in ", f);
|
||||
PyFile_WriteObject(obj, f, 0);
|
||||
if (obj) {
|
||||
PyFile_WriteString(" in ", f);
|
||||
PyFile_WriteObject(obj, f, 0);
|
||||
}
|
||||
PyFile_WriteString(" ignored\n", f);
|
||||
PyErr_Clear(); /* Just in case */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue