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 @@ -3113,7 +3113,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
3113
3113
if (config -> pycache_prefix != NULL ) {
3114
3114
SET_SYS_FROM_WSTR ("pycache_prefix" , config -> pycache_prefix );
3115
3115
} else {
3116
- PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None );
3116
+ if (PyDict_SetItemString (sysdict , "pycache_prefix" , Py_None ) < 0 ) {
3117
+ return -1 ;
3118
+ }
3117
3119
}
3118
3120
3119
3121
COPY_LIST ("argv" , config -> argv );
@@ -3127,7 +3129,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
3127
3129
SET_SYS_FROM_WSTR ("_stdlib_dir" , stdlibdir );
3128
3130
}
3129
3131
else {
3130
- PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None );
3132
+ if (PyDict_SetItemString (sysdict , "_stdlib_dir" , Py_None ) < 0 ) {
3133
+ return -1 ;
3134
+ }
3131
3135
}
3132
3136
3133
3137
#undef SET_SYS_FROM_WSTR
@@ -3137,6 +3141,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
3137
3141
// sys.flags
3138
3142
PyObject * flags = _PySys_GetObject (interp , "flags" ); // borrowed ref
3139
3143
if (flags == NULL ) {
3144
+ if (!_PyErr_Occurred (tstate )) {
3145
+ _PyErr_SetString (tstate , PyExc_RuntimeError , "lost sys.flags" );
3146
+ }
3140
3147
return -1 ;
3141
3148
}
3142
3149
if (set_flags_from_config (interp , flags ) < 0 ) {
You can’t perform that action at this time.
0 commit comments