Skip to content

Commit 75553a2

Browse files
committed
fix tests
1 parent aed1afa commit 75553a2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Lib/test/datetimetester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ def test_resolution_info(self):
825825
self.assertIsInstance(timedelta.resolution, timedelta)
826826
self.assertTrue(timedelta.max > timedelta.min)
827827
self.assertEqual(timedelta.min, timedelta(-999999999))
828-
self.assertEqual(timedelta.max, timedelta(999999999, 24*3600-1, 1e6-1))
828+
self.assertEqual(timedelta.max, timedelta(999999999, 24*3600-1, 1e6-1, 999))
829829
self.assertEqual(timedelta.resolution, timedelta(0, 0, 1))
830830

831831
def test_overflow(self):

Modules/_datetimemodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,7 @@ delta_new(PyTypeObject *type, PyObject *args, PyObject *kw)
28862886
"minutes", "hours", "weeks", NULL
28872887
};
28882888

2889-
if (PyArg_ParseTupleAndKeywords(args, kw, "|OOOOOOO:__new__",
2889+
if (PyArg_ParseTupleAndKeywords(args, kw, "|OOOOOOOO:__new__",
28902890
keywords,
28912891
&day, &second, &us, &ns,
28922892
&ms, &minute, &hour, &week) == 0)
@@ -4785,7 +4785,7 @@ time_new(PyTypeObject *type, PyObject *args, PyObject *kw)
47854785
tzinfo = Py_None;
47864786
}
47874787

4788-
if (PyArg_ParseTupleAndKeywords(args, kw, "|iiiiO$i", time_kws,
4788+
if (PyArg_ParseTupleAndKeywords(args, kw, "|iiiiO$ii", time_kws,
47894789
&hour, &minute, &second, &microsecond,
47904790
&tzinfo, &fold, &nanosecond)) {
47914791
self = new_time_ex2(hour, minute, second, microsecond, tzinfo, fold,
@@ -5540,7 +5540,7 @@ datetime_new(PyTypeObject *type, PyObject *args, PyObject *kw)
55405540
tzinfo = Py_None;
55415541
}
55425542

5543-
if (PyArg_ParseTupleAndKeywords(args, kw, "iii|iiiiO$i", datetime_kws,
5543+
if (PyArg_ParseTupleAndKeywords(args, kw, "iii|iiiiO$ii", datetime_kws,
55445544
&year, &month, &day, &hour, &minute,
55455545
&second, &microsecond, &tzinfo, &fold, &nanosecond)) {
55465546
self = new_datetime_ex2(year, month, day,
@@ -7588,7 +7588,7 @@ _datetime_exec(PyObject *module)
75887588
DATETIME_ADD_MACRO(d, "resolution", new_delta(0, 0, 0, 1, 0));
75897589
DATETIME_ADD_MACRO(d, "min", new_delta(-MAX_DELTA_DAYS, 0, 0, 0, 0));
75907590
DATETIME_ADD_MACRO(d, "max",
7591-
new_delta(MAX_DELTA_DAYS, 24*3600-1, 1000000-1, 1000-1, 0));
7591+
new_delta(MAX_DELTA_DAYS, 24*3600-1, 1000000-1, 999, 0));
75927592

75937593
/* date values */
75947594
d = _PyType_GetDict(&PyDateTime_DateType);

0 commit comments

Comments
 (0)