I have this code:
for foo in range(1,10): try: cur_write = self.connection.cursor() cur_write.execute("SELECT raise_exception(foo)"