mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-14 02:17:02 +08:00
Modernize Python exception syntax in tests
Change the exception syntax used in the tests to use the more current
except Exception as ex:
rather than the old
except Exception, ex:
Since support for Python <2.6 has been removed, all supported versions
now support the new style, and we can save one step in the Python 3
compatibility conversion.
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/98b69261-298c-13d2-f34d-836fd9c29b21%402ndquadrant.com
This commit is contained in:
@ -40,7 +40,7 @@ with plpy.subtransaction():
|
||||
with plpy.subtransaction():
|
||||
plpy.execute("INSERT INTO subtransaction_tbl VALUES (3)")
|
||||
plpy.execute("error")
|
||||
except plpy.SPIError, e:
|
||||
except plpy.SPIError as e:
|
||||
if not swallow:
|
||||
raise
|
||||
plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
|
||||
|
||||
Reference in New Issue
Block a user