We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a386908 commit c07ef1aCopy full SHA for c07ef1a
com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/util/Python3Interpreter.java
@@ -1,5 +1,6 @@
1
package com.ibm.wala.cast.python.util;
2
3
+import org.python.core.PyException;
4
import org.python.core.PyObject;
5
import org.python.core.PySystemState;
6
import org.python.util.PythonInterpreter;
@@ -17,11 +18,15 @@ public static PythonInterpreter getInterp() {
17
18
}
19
20
public Integer evalAsInteger(String expr) {
- PyObject val = getInterp().eval(expr);
21
- if (val.isInteger()) {
22
- return val.asInt();
23
- } else {
24
- return null;
+ try {
+ PyObject val = getInterp().eval(expr);
+ if (val.isInteger()) {
+ return val.asInt();
25
+ }
26
+ } catch (PyException e) {
27
+
28
29
30
+ return null;
31
32
0 commit comments