summaryrefslogtreecommitdiff
path: root/update-error-constants.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2012-01-03 11:44:54 +0100
committerStefan Behnel <stefan_ml@behnel.de>2012-01-03 11:44:54 +0100
commit7d56771f7185c318e7f631dadf5a920719a754f5 (patch)
tree8d85d12fd9f9aaf2b395c52eaa88f78be8fb6108 /update-error-constants.py
parent03d8dea33023efd430973b8d35184087c96897e0 (diff)
downloadpython-lxml-7d56771f7185c318e7f631dadf5a920719a754f5.tar.gz
minor simplifications in error constant setup code, regenerated constants from libxml2 2.7.8
Diffstat (limited to 'update-error-constants.py')
-rw-r--r--update-error-constants.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/update-error-constants.py b/update-error-constants.py
index 0cc822c9..3e735f88 100644
--- a/update-error-constants.py
+++ b/update-error-constants.py
@@ -116,7 +116,7 @@ append_pxd = pxd_result.append
append_pxd('cdef extern from "libxml/xmlerror.h":')
append_pxi('''\
-# Constants are stored in tuples of strings, for which Pyrex generates very
+# Constants are stored in tuples of strings, for which Cython generates very
# efficient setup code. To parse them, iterate over the tuples and parse each
# line in each string independently. Tuples of strings (instead of a plain
# string) are required as some C-compilers of a certain well-known OS vendor
@@ -131,13 +131,12 @@ for enum_name in ENUM_ORDER:
pxi_name, prefix = ENUM_MAP[enum_name]
append_pxd(ctypedef_indent + 'ctypedef enum %s:' % enum_name)
- append_pxi('cdef object %s' % pxi_name)
- append_pxi('%s = (u"""\\' % pxi_name)
+ append_pxi('cdef object %s = (u"""\\' % pxi_name)
prefix_len = len(prefix)
length = 2 # each string ends with '\n\0'
for name, val, descr in constants:
- if descr:
+ if descr and descr != str(val):
line = '%-50s = %7d # %s' % (name, val, descr)
else:
line = '%-50s = %7d' % (name, val)