Kaydet (Commit) ffa5cf9e authored tarafından Brett Cannon's avatar Brett Cannon

Fix bug introduced by the previous patch by changing TimeRE.__seqToRe() to

accept any iterable instead of only a sliceable object.
üst c5fa9920
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment