> >>> ex1 = "spam" > >>> try: > ... raise ex1 > ... except ex1: > ... print 'got it' The problem is that you are using strings as exceptions--that is discouraged. Instead, raise a built-in exception or subclass the Exception object. class ex1(Exception):pass class ex2(ex1):pass try: raise ex2("some ex2 error") except ex1, e: print e // m -