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_with.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_with.py')
-rwxr-xr-x | tests/test_with.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_with.py b/tests/test_with.py index 9d91b51..e5c0bc2 100755 --- a/tests/test_with.py +++ b/tests/test_with.py @@ -212,7 +212,7 @@ class WithCursorTestCase(WithTestCase): with conn.cursor('named') as cur: cur.execute("select 1/0") cur.fetchone() - except psycopg2.DataError, e: + except psycopg2.DataError as e: self.assertEqual(e.pgcode, '22012') else: self.fail("where is my exception?") |