summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_strftime.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-04-08 17:23:11 (GMT)
committerGuido van Rossum <guido@python.org>1999-04-08 17:23:11 (GMT)
commit9b112799bc4faa32cfca0faa7de5a725f6cdab29 (patch)
treee2d70c2b7200c7daa5da174220c39bc100f9e8f9 /Lib/test/test_strftime.py
parent60cc90ec98278f9472d7772d2fea9a68b0a23afc (diff)
downloadcpython-9b112799bc4faa32cfca0faa7de5a725f6cdab29.zip
cpython-9b112799bc4faa32cfca0faa7de5a725f6cdab29.tar.gz
cpython-9b112799bc4faa32cfca0faa7de5a725f6cdab29.tar.bz2
On Windows, we suddenly find, strftime() may return "" for an
unsupported format string. (I guess this is because the logic for deciding whether to reallocate the buffer or not has been improved.) This caused the test code to crash on result[0]. Fix this by assuming an empty result also means the format is not supported.
Diffstat (limited to 'Lib/test/test_strftime.py')
-rwxr-xr-xLib/test/test_strftime.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py
index e24d5d6..1ccb84b 100755
--- a/Lib/test/test_strftime.py
+++ b/Lib/test/test_strftime.py
@@ -99,7 +99,7 @@ def strftest(now):
print "Standard '%s' format gave error:" % e[0], error
continue
if re.match(e[1], result): continue
- if result[0] == '%':
+ if not result or result[0] == '%':
print "Does not support standard '%s' format (%s)" % (e[0], e[2])
else:
print "Conflict for %s (%s):" % (e[0], e[2])