summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-09-18 06:16:26 (GMT)
committerGitHub <noreply@github.com>2018-09-18 06:16:26 (GMT)
commite0c19ddc661e56cc7e694be52d3e47f1dfe5af24 (patch)
tree972122eceefcc73fac11a5caf29cdb615ebaddc8 /Lib/sre_compile.py
parent9c53fa6ad9cd23fb03867b4a1f74264c426c1772 (diff)
downloadcpython-e0c19ddc661e56cc7e694be52d3e47f1dfe5af24.zip
cpython-e0c19ddc661e56cc7e694be52d3e47f1dfe5af24.tar.gz
cpython-e0c19ddc661e56cc7e694be52d3e47f1dfe5af24.tar.bz2
bpo-34681: Rename class Pattern in sre_parse to State. (GH-9310)
Also rename corresponding attributes, parameters and variables.
Diffstat (limited to 'Lib/sre_compile.py')
-rw-r--r--Lib/sre_compile.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index e5216b7..3667042 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -597,7 +597,7 @@ def isstring(obj):
def _code(p, flags):
- flags = p.pattern.flags | flags
+ flags = p.state.flags | flags
code = []
# compile info block
@@ -772,13 +772,13 @@ def compile(p, flags=0):
dis(code)
# map in either direction
- groupindex = p.pattern.groupdict
- indexgroup = [None] * p.pattern.groups
+ groupindex = p.state.groupdict
+ indexgroup = [None] * p.state.groups
for k, i in groupindex.items():
indexgroup[i] = k
return _sre.compile(
- pattern, flags | p.pattern.flags, code,
- p.pattern.groups-1,
+ pattern, flags | p.state.flags, code,
+ p.state.groups-1,
groupindex, tuple(indexgroup)
)