More exception handling changes to be Python 2.4+ compatible.
Authored by: bugman 2012-09-28
Parent: [r17600]
Child: [r17602]