Commit b025f0e3 authored by Lingfeng Huang's avatar Lingfeng Huang
Browse files

Update prog.py

parent bf717fca
...@@ -219,7 +219,7 @@ CONTROLLER FUCNTIONS SECTION ...@@ -219,7 +219,7 @@ CONTROLLER FUCNTIONS SECTION
def afficherSql(conn,sql): def afficherSql(conn,sql):
try: try:
cur.execute(sql) cur.execute(sql)
except psycopg2.Error as e: except pg.Error as e:
print("Execute: ",e) print("Execute: ",e)
conn.rollback() conn.rollback()
return return
...@@ -235,8 +235,8 @@ def afficherSql(conn,sql): ...@@ -235,8 +235,8 @@ def afficherSql(conn,sql):
else: else:
print("Empty table") print("Empty table")
conn.commit() conn.commit()
except psycopg2.Error: except pg.Error as e:
print("Fetch error") print("Fetch error",e)
conn.rollback() conn.rollback()
def afficherStatistique(conn): def afficherStatistique(conn):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment