File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3502,7 +3502,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
35023502 if (config -> pycache_prefix != NULL ) {
35033503 SET_SYS_FROM_WSTR ("pycache_prefix" , config -> pycache_prefix );
35043504 } else {
3505- PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None );
3505+ if (PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None ) < 0 ) {
3506+ return -1 ;
3507+ }
35063508 }
35073509
35083510 COPY_LIST ("argv" , config -> argv );
@@ -3516,7 +3518,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
35163518 SET_SYS_FROM_WSTR ("_stdlib_dir" , stdlibdir );
35173519 }
35183520 else {
3519- PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None );
3521+ if (PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None ) < 0 ) {
3522+ return -1 ;
3523+ }
35203524 }
35213525
35223526#undef SET_SYS_FROM_WSTR
@@ -3526,6 +3530,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
35263530 // sys.flags
35273531 PyObject * flags = _PySys_GetObject (interp , "flags" ); // borrowed ref
35283532 if (flags == NULL ) {
3533+ if (!_PyErr_Occurred (tstate )) {
3534+ _PyErr_SetString (tstate , PyExc_RuntimeError , "lost sys.flags" );
3535+ }
35293536 return -1 ;
35303537 }
35313538 if (set_flags_from_config (interp , flags ) < 0 ) {
You can’t perform that action at this time.
0 commit comments