Exception difference 2.4 ==> 2.5

D'Arcy J.M. Cain darcy at druid.net
Wed Nov 19 08:58:22 EST 2008


On Wed, 19 Nov 2008 01:57:37 -0500
Ross Ridge <rridge at csclub.uwaterloo.ca> wrote:
> 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.

Yes, I was aware of that but the error not being caught is
RuntimeError.  I also tried a bare "except" just to be sure but same
behaviour.

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list