diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-08-22 17:20:56 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-08-22 17:29:14 +0100 |
commit | 29932c488f2a3ea771f6b0196b928bcbb0753f94 (patch) | |
tree | 7ae43c136be03b3c231e9be3bb3d9601c82c6cba /scripts/make_errorcodes.py | |
parent | 880aa07a589ccfe9854854149e24e37239f6f00b (diff) | |
download | psycopg2-29932c488f2a3ea771f6b0196b928bcbb0753f94.tar.gz |
errorcodes map updated to PostgreSQL 9.1
Diffstat (limited to 'scripts/make_errorcodes.py')
-rwxr-xr-x | scripts/make_errorcodes.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py index 8477e41..e59f399 100755 --- a/scripts/make_errorcodes.py +++ b/scripts/make_errorcodes.py @@ -30,7 +30,7 @@ def main(): filename = sys.argv[1] file_start = read_base_file(filename) - classes, errors = fetch_errors(['8.1', '8.2', '8.3', '8.4', '9.0']) + classes, errors = fetch_errors(['8.1', '8.2', '8.3', '8.4', '9.0', '9.1']) f = open(filename, "w") for line in file_start: @@ -70,11 +70,21 @@ def parse_errors(url): else: # it's an error errcode = tr.tt.string.encode("ascii") assert len(errcode) == 5 - errlabel = tr('td')[1].string.replace(" ", "_").encode("ascii") - # double check the columns are equal - cond_name = tr('td')[2].string.upper().encode("ascii") - assert errlabel == cond_name, tr + tds = tr('td') + if len(tds) == 3: + errlabel = tds[1].string.replace(" ", "_").encode("ascii") + + # double check the columns are equal + cond_name = tds[2].string.upper().encode("ascii") + assert errlabel == cond_name, tr + + elif len(tds) == 2: + # found in PG 9.1 beta3 docs + errlabel = tds[1].tt.string.upper().encode("ascii") + + else: + assert False, tr errors[class_][errcode] = errlabel |