Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
if a PyException wraps a Java Exception object, then the PyException's getCause() method should return that Java Exception object #54
If I do this in Jython: (tried with both 2.5.3 and 2.7.0 standalone)
it works fine; Jython raises a wrapped instance of java.lang.Exception. It appears to be an
Why does this matter? If the object raised within Jython is a Jython object, rather than a Java exception class, it doesn't matter. But if the object raised within Jython is some Java exception object E, and Jython is embedded within a larger Java program P, then Jython doesn't allow the larger program P to use the standard
I would suggest changing the main constructor of
Need to handle these test cases:
Changing the PyException constructor would break
I already checked that this would pass regrtests (at least doesn't make them worse). It would be ideal if you could assert that this change would solve the problem you describe. E.g. note that from Python perspective you wouldn't notice:
So here it's the same behavior as before the change.
Will do! Thanks for the quick response. If I were a bit more adept at understanding how this all works, I would file a PR myself, but it sounds like there's some real subtleties here.
edit: done -- http://bugs.jython.org/issue2547