summaryrefslogtreecommitdiff
path: root/Lib/csv.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-30 01:01:48 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-30 01:01:48 +0300
commit07360df481adeacfc2b7a1a7f89ae9a76e86b725 (patch)
tree1d111118cafc0117d3cd68fdfa7397e68dd25191 /Lib/csv.py
parent1813c1701f8e7e9287bccf66d1b4b8348c432168 (diff)
downloadcpython-git-07360df481adeacfc2b7a1a7f89ae9a76e86b725.tar.gz
Issue #14260: The groupindex attribute of regular expression pattern object
now is non-modifiable mapping.
Diffstat (limited to 'Lib/csv.py')
-rw-r--r--Lib/csv.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/csv.py b/Lib/csv.py
index a56eed88c8..c3c31f01fd 100644
--- a/Lib/csv.py
+++ b/Lib/csv.py
@@ -231,20 +231,21 @@ class Sniffer:
quotes = {}
delims = {}
spaces = 0
+ groupindex = regexp.groupindex
for m in matches:
- n = regexp.groupindex['quote'] - 1
+ n = groupindex['quote'] - 1
key = m[n]
if key:
quotes[key] = quotes.get(key, 0) + 1
try:
- n = regexp.groupindex['delim'] - 1
+ n = groupindex['delim'] - 1
key = m[n]
except KeyError:
continue
if key and (delimiters is None or key in delimiters):
delims[key] = delims.get(key, 0) + 1
try:
- n = regexp.groupindex['space'] - 1
+ n = groupindex['space'] - 1
except KeyError:
continue
if m[n]: