mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +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
|
|
@ -6,7 +6,6 @@
|
|||
#include "pycore_long.h" // _PyLong_GetZero()
|
||||
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
|
||||
#include "pycore_pystate.h" // _PyThreadState_GET()
|
||||
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttr()
|
||||
#include "pycore_traceback.h" // _Py_DisplaySourceLine()
|
||||
#include "pycore_unicodeobject.h" // _PyUnicode_EqualToASCIIString()
|
||||
|
||||
|
|
@ -678,7 +677,7 @@ show_warning(PyThreadState *tstate, PyObject *filename, int lineno,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (_PySys_GetOptionalAttr(&_Py_ID(stderr), &f_stderr) <= 0) {
|
||||
if (PySys_GetOptionalAttr(&_Py_ID(stderr), &f_stderr) <= 0) {
|
||||
fprintf(stderr, "lost sys.stderr\n");
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue