Skip to content

Commit 7fd8de6

Browse files
committed
PRaiseNativeNode should accept LazyPythonClass.
1 parent e5091a7 commit 7fd8de6

File tree

1 file changed

+10
-9
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext

1 file changed

+10
-9
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
import com.oracle.graal.python.builtins.objects.module.PythonModule;
8686
import com.oracle.graal.python.builtins.objects.str.NativeCharSequence;
8787
import com.oracle.graal.python.builtins.objects.str.PString;
88+
import com.oracle.graal.python.builtins.objects.type.LazyPythonClass;
8889
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
8990
import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
9091
import com.oracle.graal.python.builtins.objects.type.TypeNodes;
@@ -2192,43 +2193,43 @@ public static void transformToNative(PythonContext context, PFrame.Reference fra
21922193
@GenerateUncached
21932194
public abstract static class PRaiseNativeNode extends Node {
21942195

2195-
public final int raiseInt(Frame frame, int errorValue, PythonBuiltinClassType errType, String format, Object... arguments) {
2196+
public final int raiseInt(Frame frame, int errorValue, LazyPythonClass errType, String format, Object... arguments) {
21962197
return executeInt(frame, errorValue, errType, format, arguments);
21972198
}
21982199

2199-
public final Object raise(Frame frame, Object errorValue, PythonBuiltinClassType errType, String format, Object... arguments) {
2200+
public final Object raise(Frame frame, Object errorValue, LazyPythonClass errType, String format, Object... arguments) {
22002201
return execute(frame, errorValue, errType, format, arguments);
22012202
}
22022203

2203-
public final int raiseIntWithoutFrame(int errorValue, PythonBuiltinClassType errType, String format, Object... arguments) {
2204+
public final int raiseIntWithoutFrame(int errorValue, LazyPythonClass errType, String format, Object... arguments) {
22042205
return executeInt(null, errorValue, errType, format, arguments);
22052206
}
22062207

2207-
public final Object raiseWithoutFrame(Object errorValue, PythonBuiltinClassType errType, String format, Object... arguments) {
2208+
public final Object raiseWithoutFrame(Object errorValue, LazyPythonClass errType, String format, Object... arguments) {
22082209
return execute(null, errorValue, errType, format, arguments);
22092210
}
22102211

2211-
public abstract Object execute(Frame frame, Object errorValue, PythonBuiltinClassType errType, String format, Object[] arguments);
2212+
public abstract Object execute(Frame frame, Object errorValue, LazyPythonClass errType, String format, Object[] arguments);
22122213

2213-
public abstract int executeInt(Frame frame, int errorValue, PythonBuiltinClassType errType, String format, Object[] arguments);
2214+
public abstract int executeInt(Frame frame, int errorValue, LazyPythonClass errType, String format, Object[] arguments);
22142215

22152216
@Specialization
2216-
int doInt(Frame frame, int errorValue, PythonBuiltinClassType errType, String format, Object[] arguments,
2217+
static int doInt(Frame frame, int errorValue, LazyPythonClass errType, String format, Object[] arguments,
22172218
@Shared("raiseNode") @Cached PRaiseNode raiseNode,
22182219
@Shared("transformExceptionToNativeNode") @Cached TransformExceptionToNativeNode transformExceptionToNativeNode) {
22192220
raiseNative(frame, errType, format, arguments, raiseNode, transformExceptionToNativeNode);
22202221
return errorValue;
22212222
}
22222223

22232224
@Specialization
2224-
Object doObject(Frame frame, Object errorValue, PythonBuiltinClassType errType, String format, Object[] arguments,
2225+
static Object doObject(Frame frame, Object errorValue, LazyPythonClass errType, String format, Object[] arguments,
22252226
@Shared("raiseNode") @Cached PRaiseNode raiseNode,
22262227
@Shared("transformExceptionToNativeNode") @Cached TransformExceptionToNativeNode transformExceptionToNativeNode) {
22272228
raiseNative(frame, errType, format, arguments, raiseNode, transformExceptionToNativeNode);
22282229
return errorValue;
22292230
}
22302231

2231-
public static void raiseNative(Frame frame, PythonBuiltinClassType errType, String format, Object[] arguments, PRaiseNode raiseNode,
2232+
public static void raiseNative(Frame frame, LazyPythonClass errType, String format, Object[] arguments, PRaiseNode raiseNode,
22322233
TransformExceptionToNativeNode transformExceptionToNativeNode) {
22332234
try {
22342235
throw raiseNode.execute(errType, PNone.NO_VALUE, format, arguments);

0 commit comments

Comments
 (0)