diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-11-09 20:48:36 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-11-09 20:48:36 +0200 |
commit | c7f7d3897e6b0eb8bbfa7957e0a19232d05b8616 (patch) | |
tree | 1207567879b1b925572432205e7a13c0be229a84 /Lib/sre_parse.py | |
parent | bf764a1912b084e5fc9acd6cb160e66060bc368a (diff) | |
download | cpython-c7f7d3897e6b0eb8bbfa7957e0a19232d05b8616.tar.gz cpython-c7f7d3897e6b0eb8bbfa7957e0a19232d05b8616.zip |
Issue #22434: Constants in sre_constants are now named constants (enum-like).
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r-- | Lib/sre_parse.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index edc3ff143ac..768ed792ee1 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -13,7 +13,6 @@ # XXX: show string offset and offending character for all errors from sre_constants import * -from _sre import MAXREPEAT SPECIAL_CHARS = ".\\[{()*+?^$|" REPEAT_CHARS = "*+?{" @@ -103,24 +102,24 @@ class SubPattern: nl = True seqtypes = (tuple, list) for op, av in self.data: - print(level*" " + op, end='') + print(level*" " + str(op), end='') if op == IN: # member sublanguage print() for op, a in av: - print((level+1)*" " + op, a) + print((level+1)*" " + str(op), a) elif op == BRANCH: print() for i, a in enumerate(av[1]): if i: - print(level*" " + "or") + print(level*" " + "OR") a.dump(level+1) elif op == GROUPREF_EXISTS: condgroup, item_yes, item_no = av print('', condgroup) item_yes.dump(level+1) if item_no: - print(level*" " + "else") + print(level*" " + "ELSE") item_no.dump(level+1) elif isinstance(av, seqtypes): nl = False |