Exception and finally question

Erik Max Francis max at alcyone.com
Fri Apr 25 18:22:24 EDT 2003


Tung Wai Yip wrote:

>  # this probably won't mix.
>  except ,e:

Try 

	except Exception, e:

since Exception should be the base class of all exceptions.

For those that aren't, you can do

	except:

and then tricks with the exception functions/objects in the sys module.
(I have to do this in EmPy to catch strings, for instance, which are
deprecated anyway but more common in versions of Python I have to
support.)
> tung

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ To perceive is to suffer.
\__/ Aristotle
    Python chess module / http://www.alcyone.com/pyos/chess/
 A chess game adjudicator in Python.




More information about the Python-list mailing list