Skip to content

Commit 644d70a

Browse files
committed
Update sysmodule.c
issue-126108-fixedSyntax
1 parent 0946ed2 commit 644d70a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Python/sysmodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,11 +2864,9 @@ PyAPI_FUNC(void)
28642864
PySys_AddWarnOptionUnicode(PyObject *option)
28652865
{
28662866
PyThreadState *tstate = _PyThreadState_GET();
2867-
if (_PySys_AddWarnOptionWithError(tstate, option) < 0) {
2867+
if (tstate && _PySys_AddWarnOptionWithError(tstate, option) < 0) {
28682868
/* No return value, therefore clear error state if possible */
2869-
if (tstate) {
2870-
_PyErr_Clear(tstate);
2871-
}
2869+
_PyErr_Clear(tstate);
28722870
}
28732871
}
28742872

0 commit comments

Comments
 (0)