You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.RuntimeException: Error in Python interpreter:
Type: <class 'SystemError'>
Value: <method-wrapper '__len__' of list object at 0x158099dc0> returned a result with an exception set
Line: <not available>
Namespace: <not available>
File: <not available>
Traceback (most recent call last):
at org.jpy.PyLib.callAndReturnObject(Native Method)
at org.jpy.PyObject.callMethod(PyObject.java:432)
at org.jpy.PyListWrapper.size(PyListWrapper.java:36)
The text was updated successfully, but these errors were encountered:
This code doesn't bother to check for errors after the call to JPy_AS_CLONG() and there are a bunch of other methods behave the same. From a performance POV, if we insist that to void such issue, callers need to call the PyObject.isXXX() to check for the expected type first before calling the corresponding getXXX(), this would lead to one more Java/Python boundary crossing and worse performance than if the getXXX() would check for errors in the C function and raise the Java exception accordingly.
jmao-denver
changed the title
Uncaught exceptions in PyObject getIntValue() showed up in the next PyListWrapper.size() call
Uncaught exception in PyObject getIntValue() showes up in the next PyListWrapper.size() call
Mar 24, 2023
In Python,
In Java, after calling foo() and let 'obj' receive the return value as PyObject
would throw an exception
The text was updated successfully, but these errors were encountered: