Diez,

Thank you for this simple program. It helped me begin to answer a question I had previously posted about trapping "Ctl-C". (see thread: Jythonc Question...)

It turns out that when a Python program is frozen with jythonc, "Ctl-C" will throw an "EOFError" instead of a "KeyboardError".

Test code:
-------------

try:
  raw_input("\nEnter or Ctl-C")
except EOFError:
  print "\n\nKeyboardInterrrupt TRAPPED!"
else:
  print "\nKeyboardInterrrupt NOT TRAPPED!"




-----Original Message-----
From: Diez B. Roggisch [mailto:deets@web.de]
Sent: Monday, February 09, 2004 9:15 AM
To: Patrick Bielen; Jython Mailinglist
Subject: Re: [Jython-users] Again Look and Feel related


> or is there a better solution ?

You can get the thrown execption from sys.exc_info() like this:

try:
  raise SomeException
except:
  type, value, traceback = sys.exc_info()