]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix bug where __contains__ should have been used over str.find()
authorBrett Cannon <bcannon@gmail.com>
Sat, 27 Aug 2005 19:29:21 +0000 (19:29 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 27 Aug 2005 19:29:21 +0000 (19:29 +0000)
Lib/_strptime.py
Misc/NEWS

index a6b54f3a9da99ef83450d28d15ade87af92f1dc9..aa02ba12c831cc85c0e84e5b484a0389e10807d5 100644 (file)
@@ -148,7 +148,7 @@ class LocaleTime(object):
                 if old:
                     current_format = current_format.replace(old, new)
             time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0))
-            if time.strftime(directive, time_tuple).find('00'):
+            if '00' in time.strftime(directive, time_tuple):
                 U_W = '%U'
             else:
                 U_W = '%W'
index 9ea848bfd9b738c496973a269673a09cf2079665..9d22ee55167e1298799da7a592dfa0b5f667b141 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -79,6 +79,9 @@ Extension Modules
 Library
 -------
 
+- Fix a misuse of str.find() in detection of use of %U or %W in datetime
+  format.
+
 - Bug #1167128: Fix size of a symlink in a tarfile to be 0.
 
 - Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook