Skip to content

Commit 68af765

Browse files
committed
Make edits according to Copilot review.
1 parent c07ef1a commit 68af765

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/util/Python3Interpreter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package com.ibm.wala.cast.python.util;
22

3+
import java.util.logging.Level;
4+
import java.util.logging.Logger;
35
import org.python.core.PyException;
46
import org.python.core.PyObject;
57
import org.python.core.PySystemState;
68
import org.python.util.PythonInterpreter;
79

810
public class Python3Interpreter extends com.ibm.wala.cast.python.util.PythonInterpreter {
911

12+
private static final Logger LOGGER = Logger.getLogger(Python3Interpreter.class.getName());
13+
1014
private static PythonInterpreter interp;
1115

1216
public static PythonInterpreter getInterp() {
@@ -24,7 +28,8 @@ public Integer evalAsInteger(String expr) {
2428
return val.asInt();
2529
}
2630
} catch (PyException e) {
27-
31+
LOGGER.log(Level.SEVERE, "Unable to interpret Python expression: " + expr, e);
32+
throw new IllegalArgumentException("Can't interpret Python expression: " + expr + ".", e);
2833
}
2934

3035
return null;

0 commit comments

Comments
 (0)