File tree 1 file changed +9
-2
lines changed
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)
3466
3466
if (config -> pycache_prefix != NULL ) {
3467
3467
SET_SYS_FROM_WSTR ("pycache_prefix" , config -> pycache_prefix );
3468
3468
} else {
3469
- PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None );
3469
+ if (PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None ) < 0 ) {
3470
+ return -1 ;
3471
+ }
3470
3472
}
3471
3473
3472
3474
COPY_LIST ("argv" , config -> argv );
@@ -3480,7 +3482,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
3480
3482
SET_SYS_FROM_WSTR ("_stdlib_dir" , stdlibdir );
3481
3483
}
3482
3484
else {
3483
- PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None );
3485
+ if (PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None ) < 0 ) {
3486
+ return -1 ;
3487
+ }
3484
3488
}
3485
3489
3486
3490
#undef SET_SYS_FROM_WSTR
@@ -3490,6 +3494,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
3490
3494
// sys.flags
3491
3495
PyObject * flags = _PySys_GetObject (interp , "flags" ); // borrowed ref
3492
3496
if (flags == NULL ) {
3497
+ if (!_PyErr_Occurred (tstate )) {
3498
+ _PyErr_SetString (tstate , PyExc_RuntimeError , "lost sys.flags" );
3499
+ }
3493
3500
return -1 ;
3494
3501
}
3495
3502
if (set_flags_from_config (interp , flags ) < 0 ) {
You can’t perform that action at this time.
0 commit comments