Use except psycopg2.Error as e in example.

This commit is contained in:
Xing Guo 2023-07-27 09:49:46 +08:00 committed by Daniele Varrazzo
parent 9f020124f8
commit 329f43c762

View File

@ -184,7 +184,7 @@ available through the following exceptions:
>>> try:
... cur.execute("SELECT * FROM barf")
... except psycopg2.Error, e:
... except psycopg2.Error as e:
... pass
>>> e.diag.severity