Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ac01c0

Browse files
committed
Don't skip over Py_None when getting the topmost exception
1 parent c62f8ae commit 4ac01c0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Python/errors.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ _PyErr_GetTopmostException(PyThreadState *tstate)
121121
_PyErr_StackItem *exc_info = tstate->exc_info;
122122
assert(exc_info);
123123

124-
while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
125-
exc_info->previous_item != NULL)
124+
while (exc_info->exc_value == NULL && exc_info->previous_item != NULL)
126125
{
127126
exc_info = exc_info->previous_item;
128127
}

0 commit comments

Comments
 (0)