diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-11-20 20:00:35 -0800 | 
|---|---|---|
| committer | Jon Dufresne <jon.dufresne@gmail.com> | 2017-11-20 20:00:35 -0800 | 
| commit | 390e43fcb191d1b52ca747e2b71f938f9df52c95 (patch) | |
| tree | f8c6259410ddf8087fba730faacc906b09878106 /tests/test_transaction.py | |
| parent | 7a2dd85caa7553d163f6579eb513a370ef069a0e (diff) | |
| download | psycopg2-390e43fcb191d1b52ca747e2b71f938f9df52c95.tar.gz | |
Use modern except syntax throughout project
The syntax "except Exception, exc:" is deprecated. All Python versions
supported by psycopg2 support the newer, modern syntax. Forward
compatible with future Python versions.
Diffstat (limited to 'tests/test_transaction.py')
| -rwxr-xr-x | tests/test_transaction.py | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/tests/test_transaction.py b/tests/test_transaction.py index 36947de..dd487c0 100755 --- a/tests/test_transaction.py +++ b/tests/test_transaction.py @@ -145,7 +145,7 @@ class DeadlockSerializationTests(ConnectingTestCase):                  step1.set()                  step2.wait()                  curs.execute("LOCK table2 IN ACCESS EXCLUSIVE MODE") -            except psycopg2.DatabaseError, exc: +            except psycopg2.DatabaseError as exc:                  self.thread1_error = exc                  step1.set()              conn.close() @@ -158,7 +158,7 @@ class DeadlockSerializationTests(ConnectingTestCase):                  curs.execute("LOCK table2 IN ACCESS EXCLUSIVE MODE")                  step2.set()                  curs.execute("LOCK table1 IN ACCESS EXCLUSIVE MODE") -            except psycopg2.DatabaseError, exc: +            except psycopg2.DatabaseError as exc:                  self.thread2_error = exc                  step2.set()              conn.close() @@ -195,7 +195,7 @@ class DeadlockSerializationTests(ConnectingTestCase):                  step2.wait()                  curs.execute("UPDATE table1 SET name='task1' WHERE id = 1")                  conn.commit() -            except psycopg2.DatabaseError, exc: +            except psycopg2.DatabaseError as exc:                  self.thread1_error = exc                  step1.set()              conn.close() @@ -207,7 +207,7 @@ class DeadlockSerializationTests(ConnectingTestCase):                  step1.wait()                  curs.execute("UPDATE table1 SET name='task2' WHERE id = 1")                  conn.commit() -            except psycopg2.DatabaseError, exc: +            except psycopg2.DatabaseError as exc:                  self.thread2_error = exc              step2.set()              conn.close() | 
