Skip to content

Commit 8ab868d

Browse files
committed
[GR-40164] Include Java exception stack traces in wrapped Java exceptions if WithJavaStacktrace is set, and few other minor improvements.
PullRequest: graalpython/2371
2 parents ca2c035 + 3f7f912 commit 8ab868d

File tree

12 files changed

+30
-11
lines changed

12 files changed

+30
-11
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def test_tagged():
8383
if "-debug-java" in sys.argv:
8484
cmd.append("-debug-java")
8585
cmd += [RUNNER]
86+
if "-vv" in sys.argv:
87+
cmd += ['-v']
8688
for testpattern in working_test[1]:
8789
cmd.extend(["-k", testpattern])
8890
print("Running test:", working_test[0])

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinConstructors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,7 @@ public abstract static class BaseExceptionNode extends PythonVarargsBuiltinNode
25612561
public final Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments, PKeyword[] keywords) throws VarargsBuiltinDirectInvocationNotSupported {
25622562
if (arguments.length == 0) {
25632563
CompilerDirectives.transferToInterpreterAndInvalidate();
2564-
throw new VarargsBuiltinDirectInvocationNotSupported();
2564+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
25652565
}
25662566
if (arguments.length == 1) {
25672567
return initNoArgs(arguments[0], PythonUtils.EMPTY_OBJECT_ARRAY, keywords);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/CollectionsModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments,
9494
return doGeneric(arguments[0], null, null);
9595
}
9696
CompilerDirectives.transferToInterpreterAndInvalidate();
97-
throw new VarargsBuiltinDirectInvocationNotSupported();
97+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
9898
}
9999

100100
@Specialization

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SocketModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments,
212212
return socket(arguments[0]);
213213
}
214214
CompilerDirectives.transferToInterpreterAndInvalidate();
215-
throw new VarargsBuiltinDirectInvocationNotSupported();
215+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
216216
}
217217
}
218218

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments,
142142
return doGeneric(frame, self, arguments, keywords);
143143
}
144144
CompilerDirectives.transferToInterpreterAndInvalidate();
145-
throw new VarargsBuiltinDirectInvocationNotSupported();
145+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
146146
}
147147

148148
@Specialization

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/exception/BaseExceptionBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public final Object execute(PBaseException self, Object[] args) {
124124
public Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments, PKeyword[] keywords) throws VarargsBuiltinDirectInvocationNotSupported {
125125
if (arguments.length == 0) {
126126
CompilerDirectives.transferToInterpreterAndInvalidate();
127-
throw new VarargsBuiltinDirectInvocationNotSupported();
127+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
128128
}
129129
if (splitArgsNode == null) {
130130
CompilerDirectives.transferToInterpreterAndInvalidate();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/exception/ImportErrorBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public abstract static class ImportErrorInitNode extends PythonVarargsBuiltinNod
118118
public Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments, PKeyword[] keywords) throws VarargsBuiltinDirectInvocationNotSupported {
119119
if (arguments.length == 0) {
120120
CompilerDirectives.transferToInterpreterAndInvalidate();
121-
throw new VarargsBuiltinDirectInvocationNotSupported();
121+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
122122
}
123123
if (splitArgsNode == null) {
124124
CompilerDirectives.transferToInterpreterAndInvalidate();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/exception/StopIterationBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public abstract static class StopIterationInitNode extends PythonVarargsBuiltinN
8080
public final Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments, PKeyword[] keywords) {
8181
if (arguments.length == 0 || keywords.length != 0) {
8282
CompilerDirectives.transferToInterpreterAndInvalidate();
83-
throw new VarargsBuiltinDirectInvocationNotSupported();
83+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
8484
}
8585
if (splitArgsNode == null) {
8686
CompilerDirectives.transferToInterpreterAndInvalidate();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/tuple/StructSequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public final Object varArgExecute(VirtualFrame frame, Object self, Object[] argu
309309
return error(arguments[0], PythonUtils.EMPTY_OBJECT_ARRAY, PKeyword.EMPTY_KEYWORDS);
310310
}
311311
CompilerDirectives.transferToInterpreterAndInvalidate();
312-
throw new VarargsBuiltinDirectInvocationNotSupported();
312+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
313313
}
314314

315315
@Specialization

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/function/builtins/PythonVarargsBuiltinNode.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@
5252
*/
5353
public abstract class PythonVarargsBuiltinNode extends PythonBuiltinBaseNode {
5454
public static final class VarargsBuiltinDirectInvocationNotSupported extends ControlFlowException {
55+
public static final VarargsBuiltinDirectInvocationNotSupported INSTANCE = new VarargsBuiltinDirectInvocationNotSupported();
5556
private static final long serialVersionUID = 1L;
57+
58+
private VarargsBuiltinDirectInvocationNotSupported() {
59+
}
5660
}
5761

5862
/**
@@ -61,7 +65,7 @@ public static final class VarargsBuiltinDirectInvocationNotSupported extends Con
6165
@SuppressWarnings("unused")
6266
public Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments, PKeyword[] keywords)
6367
throws VarargsBuiltinDirectInvocationNotSupported {
64-
throw new VarargsBuiltinDirectInvocationNotSupported();
68+
throw VarargsBuiltinDirectInvocationNotSupported.INSTANCE;
6569
}
6670

6771
/**

0 commit comments

Comments
 (0)