Skip to content

Commit 7483b9f

Browse files
committed
Fix accidentally clearing caught exception
1 parent 1c115f5 commit 7483b9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/ExternalFunctionNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ static Object invoke(VirtualFrame frame, Node inliningTarget, PythonThreadState
887887
* Special case after calling a C function: transfer caught exception back to frame
888888
* to simulate the global state semantics.
889889
*/
890-
if (frame != null) {
890+
if (frame != null && threadState.getCaughtException() != null) {
891891
PArguments.setException(frame, threadState.getCaughtException());
892892
}
893893
IndirectCallContext.exit(frame, threadState, state);

0 commit comments

Comments
 (0)