]> granicus.if.org Git - python/commitdiff
Merge from 3.1
authorSenthil Kumaran <orsenthil@gmail.com>
Wed, 6 Apr 2011 06:11:09 +0000 (14:11 +0800)
committerSenthil Kumaran <orsenthil@gmail.com>
Wed, 6 Apr 2011 06:11:09 +0000 (14:11 +0800)
1  2 
Lib/test/test_time.py
Modules/timemodule.c

index 2b58093f92909421a610223c78f9b6fe932536fe,65b273557f3995f0fdf40c23b9f1584eb25a0313..8499af81577107554a4b100ecbe20ecf8fa871dc
@@@ -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):
  
              except ValueError:
                  self.fail('conversion specifier: %r failed.' % format)
  
 -    def test_strftime_bounds_checking(self):
+         # 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 _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).
  
Simple merge