|
From: <pj...@us...> - 2011-03-21 23:11:31
|
Revision: 7260
http://jython.svn.sourceforge.net/jython/?rev=7260&view=rev
Author: pjenvey
Date: 2011-03-21 23:11:25 +0000 (Mon, 21 Mar 2011)
Log Message:
-----------
better support for Java exceptions in writeUnraisable
Modified Paths:
--------------
trunk/jython/src/org/python/core/Py.java
Modified: trunk/jython/src/org/python/core/Py.java
===================================================================
--- trunk/jython/src/org/python/core/Py.java 2011-03-21 23:10:49 UTC (rev 7259)
+++ trunk/jython/src/org/python/core/Py.java 2011-03-21 23:11:25 UTC (rev 7260)
@@ -1208,15 +1208,10 @@
return buf.toString();
}
- public static void writeUnraisable(Exception exc, PyObject obj) {
- if (exc instanceof PyException) {
- PyException pye = (PyException) exc;
- stderr.println(String.format("Exception %s in %s ignored",
- formatException(pye.type, pye.value, true), obj));
- } else {
- // XXX: this could be better handled
- exc.printStackTrace();
- }
+ public static void writeUnraisable(Throwable unraisable, PyObject obj) {
+ PyException pye = JavaError(unraisable);
+ stderr.println(String.format("Exception %s in %s ignored",
+ formatException(pye.type, pye.value, true), obj));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|