|
From: Ype K. <yk...@xs...> - 2001-03-15 19:40:17
|
Dear jtyhon developers,
I had google look for some earlier discussion on this subject
as I vaguely recall java and jython exceptions being discussed
not too long ago. However I could not find anything specific
on my problem.
I have roughly the following situation:
import java
somejythonfile = ....
try:
execfile(somejythonfile)
except SomePythonDeclaredException, ke:
nicelyCaught = ke
except java.lang.OutOfMemoryError, oome:
neverCaught = oome
except Exception, e:
someTimesCaught = e
except:
# some releases ago, I tried this to catch an occasional
# internal compiler error, and then it never occurred again...
ei = sys.exc_info
...
My problem is that java.lang.OutOfMemoryError is never caught,
even when 'somejythonfile' causes it.
I also tried to catch java.lang.Throwable, but it flew along as well.
Do I have to go through some java code:
try {
org.python.core.__builtin__.execfile(somejythonfile);
// or whatever it is called in java
} catch (java.lang.OutOfMemoryException oome) {
throw org.python.core.PyException(oome.toString());
}
or can it be done directly in jython?
I realize that running out of memory is tricky business, but
it would be nice if catching this exception would be possible...
Thanks in advance,
Ype
|