[Python-3000] try ... then ... then ... except / finally

Georg Brandl g.brandl at gmx.net
Thu Oct 12 10:31:40 CEST 2006


Antoine wrote:

> try:
>     self.db_transaction.commit()
> then:
>     self.tmpoutfile.close()
> then:
>     self.destroy_shared_memory_handle()
> except Exception, e:
>     logging.error("an exception occurred in cleanup: %s", e)


Can you explain the difference to:

try:
     self.db_transaction.commit()
     self.tmpoutfile.close()
     self.destroy_shared_memory_handle()
except Exception, e:
     logging.error("an exception occurred in cleanup: %s", e)


Geor



More information about the Python-3000 mailing list