diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2017-10-19 02:16:27 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2017-10-19 02:28:52 +0100 |
commit | f1461d2d7ed1beff28c37d24b02d4e35c81b2d83 (patch) | |
tree | 4682c12461310a77251c9f024aca3d543748d1e5 /scripts | |
parent | 582fd95986789ef30c879219ec9b07a7802b05dd (diff) | |
download | psycopg2-f1461d2d7ed1beff28c37d24b02d4e35c81b2d83.tar.gz |
Parse PG 10 error codes from final version
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/make_errorcodes.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py index 73aeed9..1769ba5 100755 --- a/scripts/make_errorcodes.py +++ b/scripts/make_errorcodes.py @@ -32,10 +32,10 @@ def main(): filename = sys.argv[1] file_start = read_base_file(filename) - # If you add a version to the list fix the docs (errorcodes.rst, err.rst) + # If you add a version to the list fix the docs (in errorcodes.rst) classes, errors = fetch_errors( ['8.1', '8.2', '8.3', '8.4', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5', - '9.6', '10 b1']) + '9.6', '10']) f = open(filename, "w") for line in file_start: @@ -146,13 +146,18 @@ def fetch_errors(versions): if tver < (9, 1): c1, e1 = parse_errors_sgml(errors_sgml_url % version) else: - # TODO: move to 10 stable when released. - if version == '10 b1': - tag = 'REL_10_BETA1' - else: - tag = 'REL%s_STABLE' % version.replace('.', '_') + tag = '%s%s_STABLE' % ( + (tver[0] >= 10 and 'REL_' or 'REL'), + version.replace('.', '_')) c1, e1 = parse_errors_txt(errors_txt_url % tag) classes.update(c1) + + # TODO: this error was added in PG 10 beta 1 but dropped in the + # final release. It doesn't harm leaving it in the file. Check if it + # will be added back in PG 11. + # https://github.com/postgres/postgres/commit/28e0727076 + errors['55']['55P04'] = 'UNSAFE_NEW_ENUM_VALUE_USAGE' + for c, cerrs in e1.iteritems(): errors[c].update(cerrs) |