Skip to content

Commit d10520e

Browse files
committed
ignore catches during core initialization
1 parent 5478b72 commit d10520e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement/TryExceptNodeMessageResolution.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ static CatchesFunction doit(TryExceptNode object, String name, LookupAndCallBina
113113
ArrayList<Object> literalCatches = new ArrayList<>();
114114
ExceptNode[] exceptNodes = object.getExceptNodes();
115115
PythonModule builtins = object.getContext().getBuiltins();
116+
if (builtins == null) {
117+
return new CatchesFunction(null, null);
118+
}
116119

117120
for (ExceptNode node : exceptNodes) {
118121
PNode exceptType = node.getExceptType();
@@ -182,6 +185,9 @@ static class CatchesFunction implements TruffleObject {
182185

183186
@ExplodeLoop
184187
boolean catches(Object exception) {
188+
if (isInstance == null) {
189+
return false;
190+
}
185191
if (exception instanceof PBaseException) {
186192
PArguments.setArgument(args, 0, exception);
187193
try {

0 commit comments

Comments
 (0)