mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-108512: Add and use new replacements for PySys_GetObject() (GH-111035)
Add functions PySys_GetAttr(), PySys_GetAttrString(), PySys_GetOptionalAttr() and PySys_GetOptionalAttrString().
This commit is contained in:
parent
b265a7ddeb
commit
bac3fcba5b
32 changed files with 287 additions and 93 deletions
|
|
@ -10,7 +10,6 @@
|
|||
#include "pycore_object_deferred.h" // _PyObject_SetDeferredRefcount()
|
||||
#include "pycore_pylifecycle.h"
|
||||
#include "pycore_pystate.h" // _PyThreadState_SetCurrent()
|
||||
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttr()
|
||||
#include "pycore_time.h" // _PyTime_FromSeconds()
|
||||
#include "pycore_weakref.h" // _PyWeakref_GET_REF()
|
||||
|
||||
|
|
@ -2290,7 +2289,7 @@ thread_excepthook(PyObject *module, PyObject *args)
|
|||
PyObject *thread = PyStructSequence_GET_ITEM(args, 3);
|
||||
|
||||
PyObject *file;
|
||||
if (_PySys_GetOptionalAttr( &_Py_ID(stderr), &file) < 0) {
|
||||
if (PySys_GetOptionalAttr( &_Py_ID(stderr), &file) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (file == NULL || file == Py_None) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue