File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/exception Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -138,27 +138,35 @@ public boolean isExit() {
138
138
return exit ;
139
139
}
140
140
141
+ private static void popException (PythonCore core ) {
142
+ core .getContext ().setCurrentException (null );
143
+ }
144
+
141
145
public void expectIndexError (PythonCore core , ConditionProfile profile ) {
142
146
if (profile .profile (getType () != core .getErrorClass (PythonErrorType .IndexError ))) {
143
147
throw this ;
144
148
}
149
+ popException (core );
145
150
}
146
151
147
152
public void expectStopIteration (PythonCore core , ConditionProfile profile ) {
148
153
if (profile .profile (getType () != core .getErrorClass (PythonErrorType .StopIteration ))) {
149
154
throw this ;
150
155
}
156
+ popException (core );
151
157
}
152
158
153
159
public void expectAttributeError (PythonCore core , ConditionProfile profile ) {
154
160
if (profile .profile (getType () != core .getErrorClass (PythonErrorType .AttributeError ))) {
155
161
throw this ;
156
162
}
163
+ popException (core );
157
164
}
158
165
159
166
public void expect (PythonErrorType error , PythonCore core , ConditionProfile profile ) {
160
167
if (profile .profile (getType () != core .getErrorClass (error ))) {
161
168
throw this ;
162
169
}
170
+ popException (core );
163
171
}
164
172
}
You can’t perform that action at this time.
0 commit comments