File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -192,21 +192,24 @@ _io__WindowsConsoleIO_close_impl(winconsoleio *self)
192
192
/*[clinic end generated code: output=27ef95b66c29057b input=68c4e5754f8136c2]*/
193
193
{
194
194
PyObject * res ;
195
- PyObject * exc , * val , * tb ;
195
+ PyObject * exc ;
196
196
int rc ;
197
197
res = PyObject_CallMethodOneArg ((PyObject * )& PyRawIOBase_Type ,
198
198
& _Py_ID (close ), (PyObject * )self );
199
199
if (!self -> closefd ) {
200
200
self -> fd = -1 ;
201
201
return res ;
202
202
}
203
- if (res == NULL )
204
- PyErr_Fetch (& exc , & val , & tb );
203
+ if (res == NULL ) {
204
+ exc = PyErr_GetRaisedException ();
205
+ }
205
206
rc = internal_close (self );
206
- if (res == NULL )
207
- _PyErr_ChainExceptions (exc , val , tb );
208
- if (rc < 0 )
207
+ if (res == NULL ) {
208
+ _PyErr_ChainExceptions1 (exc );
209
+ }
210
+ if (rc < 0 ) {
209
211
Py_CLEAR (res );
212
+ }
210
213
return res ;
211
214
}
212
215
You can’t perform that action at this time.
0 commit comments