]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix bug where str.find() was being misused where __contains__ should have been
authorBrett Cannon <bcannon@gmail.com>
Sat, 27 Aug 2005 19:25:59 +0000 (19:25 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 27 Aug 2005 19:25:59 +0000 (19:25 +0000)
used.

Lib/_strptime.py

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'