mirror of
https://github.com/python/cpython.git
synced 2025-12-10 02:50:09 +00:00
is used as a sentinel () to detect if -1 is really an error or a valid timestamp. On AIX, tm_wday is unchanged even on success and so cannot be used as a sentinel.
This commit is contained in:
parent
42a526c60f
commit
8c8b4e0ebf
1 changed files with 7 additions and 0 deletions
|
|
@ -346,6 +346,13 @@ class TimeTestCase(unittest.TestCase):
|
||||||
def test_mktime(self):
|
def test_mktime(self):
|
||||||
# Issue #1726687
|
# Issue #1726687
|
||||||
for t in (-2, -1, 0, 1):
|
for t in (-2, -1, 0, 1):
|
||||||
|
if sys.platform.startswith('aix') and t == -1:
|
||||||
|
# Issue #11188, #19748: mktime() returns -1 on error. On Linux,
|
||||||
|
# the tm_wday field is used as a sentinel () to detect if -1 is
|
||||||
|
# really an error or a valid timestamp. On AIX, tm_wday is
|
||||||
|
# unchanged even on success and so cannot be used as a
|
||||||
|
# sentinel.
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
tt = time.localtime(t)
|
tt = time.localtime(t)
|
||||||
except (OverflowError, OSError):
|
except (OverflowError, OSError):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue