summaryrefslogtreecommitdiffstats
path: root/Lib/sre_constants.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2004-08-25 02:22:30 (GMT)
committerBarry Warsaw <barry@python.org>2004-08-25 02:22:30 (GMT)
commit8bee76106e8da9fd6011432d2f60861a94c623db (patch)
tree813980417d605a18837bead1951ff22a8e2b10b6 /Lib/sre_constants.py
parentc8854434790d3a281f0ea5a4714e5c01414413b0 (diff)
downloadcpython-8bee76106e8da9fd6011432d2f60861a94c623db.zip
cpython-8bee76106e8da9fd6011432d2f60861a94c623db.tar.gz
cpython-8bee76106e8da9fd6011432d2f60861a94c623db.tar.bz2
PEP 292 classes Template and SafeTemplate are added to the string module.
This patch includes test cases and documentation updates, as well as NEWS file updates. This patch also updates the sre modules so that they don't import the string module, breaking direct circular imports.
Diffstat (limited to 'Lib/sre_constants.py')
-rw-r--r--Lib/sre_constants.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/sre_constants.py b/Lib/sre_constants.py
index 002b195..1863f48 100644
--- a/Lib/sre_constants.py
+++ b/Lib/sre_constants.py
@@ -217,12 +217,11 @@ SRE_INFO_LITERAL = 2 # entire pattern is literal (given by prefix)
SRE_INFO_CHARSET = 4 # pattern starts with character from given set
if __name__ == "__main__":
- import string
def dump(f, d, prefix):
items = d.items()
items.sort(key=lambda a: a[1])
for k, v in items:
- f.write("#define %s_%s %s\n" % (prefix, string.upper(k), v))
+ f.write("#define %s_%s %s\n" % (prefix, k.upper(), v))
f = open("sre_constants.h", "w")
f.write("""\
/*