mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Merged revisions 87648,87656 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87648 | alexander.belopolsky | 2011-01-02 15:48:22 -0500 (Sun, 02 Jan 2011) | 1 line Issue #8013: Fixed time.asctime segfault when OS's asctime fails ........ r87656 | alexander.belopolsky | 2011-01-02 17:16:10 -0500 (Sun, 02 Jan 2011) | 1 line Issue #8013: Fixed test ........
This commit is contained in:
parent
9e7d6e598c
commit
8009e8e0e2
2 changed files with 14 additions and 0 deletions
|
@ -114,6 +114,16 @@ class TimeTestCase(unittest.TestCase):
|
|||
def test_asctime(self):
|
||||
time.asctime(time.gmtime(self.t))
|
||||
self.assertRaises(TypeError, time.asctime, 0)
|
||||
self.assertRaises(TypeError, time.asctime, ())
|
||||
# XXX: Posix compiant asctime should refuse to convert
|
||||
# year > 9999, but Linux implementation does not.
|
||||
# self.assertRaises(ValueError, time.asctime,
|
||||
# (12345, 1, 0, 0, 0, 0, 0, 0, 0))
|
||||
# XXX: For now, just make sure we don't have a crash:
|
||||
try:
|
||||
time.asctime((12345, 1, 0, 0, 0, 0, 0, 0, 0))
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
@unittest.skipIf(not hasattr(time, "tzset"),
|
||||
"time module has no attribute tzset")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue