mirror of
https://github.com/python/cpython.git
synced 2025-09-12 11:46:52 +00:00
bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)
This commit is contained in:
parent
a180b007d9
commit
a24107b04c
31 changed files with 538 additions and 242 deletions
|
@ -508,10 +508,14 @@ pymain_free(_PyMain *pymain)
|
|||
static int
|
||||
pymain_sys_path_add_path0(PyInterpreterState *interp, PyObject *path0)
|
||||
{
|
||||
_Py_IDENTIFIER(path);
|
||||
PyObject *sys_path;
|
||||
PyObject *sysdict = interp->sysdict;
|
||||
if (sysdict != NULL) {
|
||||
sys_path = PyDict_GetItemString(sysdict, "path");
|
||||
sys_path = _PyDict_GetItemIdWithError(sysdict, &PyId_path);
|
||||
if (sys_path == NULL && PyErr_Occurred()) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sys_path = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue