class MyError: passdef oops(): raise MyError()def doomed(): try: oops() except IndexError: print 'caught an index error!' except MyError, data: print 'caught error:', MyError, data else: print 'no error caught...'if __name__ == '__main__': doomed()
Name (required)
email (will not be published) (required)
Website