summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2004-10-06 22:48:58 (GMT)
committerBrett Cannon <bcannon@gmail.com>2004-10-06 22:48:58 (GMT)
commitffa5cf9eae5fff1e46e8962cd957fd2ffe5a77cb (patch)
tree4a24a2e791b6dda9b08c3bdd093ab1a61b359c17
parentc5fa992069b0e9588805573f0f4a685980bbcc05 (diff)
downloadcpython-ffa5cf9eae5fff1e46e8962cd957fd2ffe5a77cb.zip
cpython-ffa5cf9eae5fff1e46e8962cd957fd2ffe5a77cb.tar.gz
cpython-ffa5cf9eae5fff1e46e8962cd957fd2ffe5a77cb.tar.bz2
Fix bug introduced by the previous patch by changing TimeRE.__seqToRe() to
accept any iterable instead of only a sliceable object.
-rw-r--r--Lib/_strptime.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index 5300570..17460ce 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -226,13 +226,12 @@ class TimeRE(dict):
matching when 'abcdef' should have been the match).
"""
+ to_convert = sorted(to_convert, key=len, reverse=True)
for value in to_convert:
if value != '':
break
else:
return ''
- to_convert = to_convert[:]
- to_convert.sort(key=len, reverse=True)
regex = '|'.join(re_escape(stuff) for stuff in to_convert)
regex = '(?P<%s>%s' % (directive, regex)
return '%s)' % regex