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 @@ -3502,7 +3502,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
3502
3502
if (config -> pycache_prefix != NULL ) {
3503
3503
SET_SYS_FROM_WSTR ("pycache_prefix" , config -> pycache_prefix );
3504
3504
} else {
3505
- PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None );
3505
+ if (PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None ) < 0 ) {
3506
+ return -1 ;
3507
+ }
3506
3508
}
3507
3509
3508
3510
COPY_LIST ("argv" , config -> argv );
@@ -3516,7 +3518,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
3516
3518
SET_SYS_FROM_WSTR ("_stdlib_dir" , stdlibdir );
3517
3519
}
3518
3520
else {
3519
- PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None );
3521
+ if (PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None ) < 0 ) {
3522
+ return -1 ;
3523
+ }
3520
3524
}
3521
3525
3522
3526
#undef SET_SYS_FROM_WSTR
@@ -3526,6 +3530,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
3526
3530
// sys.flags
3527
3531
PyObject * flags = _PySys_GetObject (interp , "flags" ); // borrowed ref
3528
3532
if (flags == NULL ) {
3533
+ if (!_PyErr_Occurred (tstate )) {
3534
+ _PyErr_SetString (tstate , PyExc_RuntimeError , "lost sys.flags" );
3535
+ }
3529
3536
return -1 ;
3530
3537
}
3531
3538
if (set_flags_from_config (interp , flags ) < 0 ) {
You can’t perform that action at this time.
0 commit comments