From 6d83b1af7c31f46045cdec7ff4a53af15a216c67 Mon Sep 17 00:00:00 2001 From: EG Date: Sat, 11 May 2019 09:34:51 -0400 Subject: [PATCH] double bleh: AttributeError: module 'psycopg2' has no attribute 'errors' --- builder/dbinteraction/versioning.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/builder/dbinteraction/versioning.py b/builder/dbinteraction/versioning.py index 9550de2..59dfbf5 100644 --- a/builder/dbinteraction/versioning.py +++ b/builder/dbinteraction/versioning.py @@ -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)