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 @@ -3466,7 +3466,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
34663466 if (config -> pycache_prefix != NULL ) {
34673467 SET_SYS_FROM_WSTR ("pycache_prefix" , config -> pycache_prefix );
34683468 } else {
3469- PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None );
3469+ if (PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None ) < 0 ) {
3470+ return -1 ;
3471+ }
34703472 }
34713473
34723474 COPY_LIST ("argv" , config -> argv );
@@ -3480,7 +3482,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
34803482 SET_SYS_FROM_WSTR ("_stdlib_dir" , stdlibdir );
34813483 }
34823484 else {
3483- PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None );
3485+ if (PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None ) < 0 ) {
3486+ return -1 ;
3487+ }
34843488 }
34853489
34863490#undef SET_SYS_FROM_WSTR
@@ -3490,6 +3494,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
34903494 // sys.flags
34913495 PyObject * flags = _PySys_GetObject (interp , "flags" ); // borrowed ref
34923496 if (flags == NULL ) {
3497+ if (!_PyErr_Occurred (tstate )) {
3498+ _PyErr_SetString (tstate , PyExc_RuntimeError , "lost sys.flags" );
3499+ }
34933500 return -1 ;
34943501 }
34953502 if (set_flags_from_config (interp , flags ) < 0 ) {
You can’t perform that action at this time.
0 commit comments