Skip to content

Commit c51f524

Browse files
committed
Clear error after failing to convert number.
The correct error will be set before returning, if setError is true (previously in this case setError was effectively being ignored).
1 parent c2ca646 commit c51f524

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/runtime/converter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result,
434434
#endif
435435
op = Runtime.PyNumber_Long(value);
436436
if (op == IntPtr.Zero) {
437+
Exceptions.Clear();
437438
if (Exceptions.ExceptionMatches(overflow)) {
438439
goto overflow;
439440
}

0 commit comments

Comments
 (0)