Skip to content

Commit

Permalink
double bleh: AttributeError: module 'psycopg2' has no attribute 'errors'
Browse files Browse the repository at this point in the history
  • Loading branch information
e-gun committed May 11, 2019
1 parent c920099 commit 6d83b1a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions builder/dbinteraction/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,14 @@ def timestampthebuild(corpusname: str, dbconnection=None):

try:
dbcursor.execute(q, d)
except psycopg2.errors.UndefinedColumn:
# you tried to add to an old version table
versiontablemaker(dbconnection)
dbcursor.execute(q, d)
except psycopg2.errors.StringDataRightTruncation:
# you tried to add to an old version table with 'corpusbuilddate character varying(20)'
versiontablemaker(dbconnection)
dbcursor.execute(q, d)
except AttributeError:
# AttributeError: module 'psycopg2' has no attribute 'errors'
except:
# psycopg2.errors.UndefinedColumn:
# you tried to add to an old version table
# psycopg2.errors.StringDataRightTruncation:
# you tried to add to an old version table with 'corpusbuilddate character varying(20)'
# AttributeError:
# module 'psycopg2' has no attribute 'errors'
# owing to the possibility of the last, we skip the prior two... [bleh]
versiontablemaker(dbconnection)
dbcursor.execute(q, d)

Expand Down

0 comments on commit 6d83b1a

Please sign in to comment.