aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Python/sysmodule.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2023-10-03 23:32:21 +0300
committershadchin <shadchin@yandex-team.com>2023-10-03 23:48:51 +0300
commit01ffd024041ac933854c367fb8d1b5682d19883f (patch)
treeb70aa497ba132a133ccece49f7763427dcd0743f /contrib/tools/python3/src/Python/sysmodule.c
parenta33fdb9a34581fd124e92535153b1f1fdeca6aaf (diff)
downloadydb-01ffd024041ac933854c367fb8d1b5682d19883f.tar.gz
Update Python 3 to 3.11.6
Diffstat (limited to 'contrib/tools/python3/src/Python/sysmodule.c')
-rw-r--r--contrib/tools/python3/src/Python/sysmodule.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/tools/python3/src/Python/sysmodule.c b/contrib/tools/python3/src/Python/sysmodule.c
index 5da1381bbc..25fcd4aecf 100644
--- a/contrib/tools/python3/src/Python/sysmodule.c
+++ b/contrib/tools/python3/src/Python/sysmodule.c
@@ -3113,7 +3113,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
if (config->pycache_prefix != NULL) {
SET_SYS_FROM_WSTR("pycache_prefix", config->pycache_prefix);
} else {
- PyDict_SetItemString(sysdict, "pycache_prefix", Py_None);
+ if (PyDict_SetItemString(sysdict, "pycache_prefix", Py_None) < 0) {
+ return -1;
+ }
}
COPY_LIST("argv", config->argv);
@@ -3127,7 +3129,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
SET_SYS_FROM_WSTR("_stdlib_dir", stdlibdir);
}
else {
- PyDict_SetItemString(sysdict, "_stdlib_dir", Py_None);
+ if (PyDict_SetItemString(sysdict, "_stdlib_dir", Py_None) < 0) {
+ return -1;
+ }
}
#undef SET_SYS_FROM_WSTR
@@ -3137,6 +3141,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
// sys.flags
PyObject *flags = _PySys_GetObject(interp, "flags"); // borrowed ref
if (flags == NULL) {
+ if (!_PyErr_Occurred(tstate)) {
+ _PyErr_SetString(tstate, PyExc_RuntimeError, "lost sys.flags");
+ }
return -1;
}
if (set_flags_from_config(interp, flags) < 0) {