[Python-checkins] python/dist/src/Lib _strptime.py,1.34,1.35
bcannon at users.sourceforge.net
bcannon at users.sourceforge.net
Thu Oct 7 00:49:01 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4995/Lib
Modified Files:
_strptime.py
Log Message:
Fix bug introduced by the previous patch by changing TimeRE.__seqToRe() to
accept any iterable instead of only a sliceable object.
Index: _strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- _strptime.py 6 Oct 2004 02:23:14 -0000 1.34
+++ _strptime.py 6 Oct 2004 22:48:58 -0000 1.35
@@ -226,13 +226,12 @@
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
More information about the Python-checkins
mailing list