From: Senthil Kumaran Date: Wed, 6 Apr 2011 06:11:09 +0000 (+0800) Subject: Merge from 3.1 X-Git-Tag: v3.2.1b1~172 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae664fb528c86da44fbb9350cca05659c206bfc2;p=python Merge from 3.1 --- ae664fb528c86da44fbb9350cca05659c206bfc2 diff --cc Lib/test/test_time.py index 2b58093f92,65b273557f..8499af8157 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@@ -2,8 -2,7 +2,9 @@@ from test import suppor import time import unittest import locale +import sysconfig + import sys +import warnings class TimeTestCase(unittest.TestCase): @@@ -39,7 -38,14 +40,14 @@@ except ValueError: self.fail('conversion specifier: %r failed.' % format) + # Issue #10762: Guard against invalid/non-supported format string + # so that Python don't crash (Windows crashes when the format string + # input to [w]strftime is not kosher. + if sys.platform.startswith('win'): + with self.assertRaises(ValueError): + time.strftime('%f') + - def test_strftime_bounds_checking(self): + def _bounds_checking(self, func=time.strftime): # Make sure that strftime() checks the bounds of the various parts #of the time tuple (0 is valid for *all* values).