Mercurial > sqlpython
changeset 484:b7782506b5f3
don't get stuck if error during exit-commit
author | Catherine Devlin <catherine.devlin@gmail.com> |
---|---|
date | Wed, 25 Aug 2010 23:48:09 -0400 |
parents | c5c1786cdee2 |
children | 885c275ee790 |
files | sqlpython/sqlpython.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/sqlpython/sqlpython.py Wed Aug 25 18:52:49 2010 -0400 +++ b/sqlpython/sqlpython.py Wed Aug 25 23:48:09 2010 -0400 @@ -83,7 +83,11 @@ self.list_instances() return if self.commit_on_exit: - instance.connection.commit() + try: + instance.connection.commit() + except Exception, e: + self.perror('Error while committing:') + self.perror(str(e)) self.instances.pop(instance_number) if instance_number == self.instance_number: self.no_instance()