Exception difference 2.4 ==> 2.5

Ross Ridge rridge at csclub.uwaterloo.ca
Wed Nov 19 01:57:37 EST 2008


D'Arcy J.M. Cain <darcy at druid.net> wrote:
>Under Python 2.4 this works fine.  If an exception is raised in the
>looked up method it gets handled by this code just fine.  Under 2.5,
>however, the exception is not caught here.  It's as if there was no
>try/except here at all.

Python 2.5 changed the exception hierarchy a bit.  The Exception class
is no longer at the root and now inheirits from BaseException.  If the
exception being thrown was KeyboardInterrupt or SystemExit then it won't
be caught by your code.

					Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge at csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/~rridge/ 
 db  //	  



More information about the Python-list mailing list