summaryrefslogtreecommitdiff
path: root/scripts/make_errorcodes.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2014-08-28 02:05:54 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2014-08-28 02:17:57 +0100
commit6705e4051dc97256fb1d2f59773c84d43dcb0589 (patch)
tree54d783dd8b03e2c028f4187ae482f4b526351e7a /scripts/make_errorcodes.py
parentccc30e1877a76c5affe1cdd9c7384f62e54a1d63 (diff)
downloadpsycopg2-6705e4051dc97256fb1d2f59773c84d43dcb0589.tar.gz
Dropped creation of errcodes with missing spec field
On further inspection these names are just aliases for values already defined: we don't need the duplication.
Diffstat (limited to 'scripts/make_errorcodes.py')
-rwxr-xr-xscripts/make_errorcodes.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py
index d6e2533..122e0d5 100755
--- a/scripts/make_errorcodes.py
+++ b/scripts/make_errorcodes.py
@@ -72,15 +72,10 @@ def parse_errors_txt(url):
m = re.match(r"(.....)\s+(?:E|W|S)\s+ERRCODE_(\S+)(?:\s+(\S+))?$", line)
if m:
errcode, macro, spec = m.groups()
- # error 22008 has 2 macros and 1 def: give priority to the def
- # as it's the one we used to parse from sgml
+ # skip errcodes without specs as they are not publically visible
if not spec:
- if errcode in errors[class_]:
- continue
- errlabel = macro.upper()
- else:
- errlabel = spec.upper()
-
+ continue
+ errlabel = spec.upper()
errors[class_][errcode] = errlabel
continue