Comment 5 for bug 416629

Revision history for this message
Sidnei da Silva (sidnei) wrote :

[1] I find it odd that one of the new blocks catches both (OperationalError, DatabaseError), and the other catches only OperationalError. Shouldn't they both catch the same exception.

[2] Additionally, a try: except: else is being used, which means that if by any chance a different exception is raised other than the ones that are being catched the cursor will not be closed. I would change that to try: (try: except: pass) finally: cursor.close() instead.

+1 with those changes done, or a good justification. :)