summaryrefslogtreecommitdiff
path: root/Tools/scripts/parseentities.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-04-04 21:28:14 -0400
committerR David Murray <rdmurray@bitdance.com>2012-04-04 21:28:14 -0400
commit5ad2d9a701073fe1c1adb12642e6191a36f594a0 (patch)
tree4862f9d28c5d4e7a4261f10e59563d2c2454fd86 /Tools/scripts/parseentities.py
parent8765e09a47e18074c96fa98b541933641bcae5ff (diff)
downloadcpython-5ad2d9a701073fe1c1adb12642e6191a36f594a0.tar.gz
#14490, #14491: add 'sundry'-style import tests for Tools/scripts.
This patch changes a few of the scripts to have __name__=='__main__' clauses so that they are importable without running. Also fixes the syntax errors revealed by the tests.
Diffstat (limited to 'Tools/scripts/parseentities.py')
-rwxr-xr-xTools/scripts/parseentities.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Tools/scripts/parseentities.py b/Tools/scripts/parseentities.py
index 5b0f1c6741..a042d1c24c 100755
--- a/Tools/scripts/parseentities.py
+++ b/Tools/scripts/parseentities.py
@@ -13,7 +13,6 @@
"""
import re,sys
-import TextTools
entityRE = re.compile('<!ENTITY +(\w+) +CDATA +"([^"]+)" +-- +((?:.|\n)+?) *-->')
@@ -45,7 +44,7 @@ def writefile(f,defs):
charcode = repr(charcode)
else:
charcode = repr(charcode)
- comment = TextTools.collapse(comment)
+ comment = ' '.join(comment.split())
f.write(" '%s':\t%s, \t# %s\n" % (name,charcode,comment))
f.write('\n}\n')