Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Polishing.
  • Loading branch information
serhiy-storchaka committed Jul 12, 2025
commit b276aac3b5b81d5faf85f987978cf1e9377de5c2
6 changes: 2 additions & 4 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3355,8 +3355,7 @@ datetime_date_fromordinal_impl(PyTypeObject *type, int ordinal)
int day;

if (ordinal < 1) {
PyErr_SetString(PyExc_ValueError, "ordinal must be "
">= 1");
PyErr_SetString(PyExc_ValueError, "ordinal must be >= 1");
return NULL;
}
ord_to_ymd(ordinal, &year, &month, &day);
Expand Down Expand Up @@ -6547,8 +6546,7 @@ datetime_richcompare(PyObject *self, PyObject *other, int op)
PyDateTime_Delta *delta;

assert(offset1 != offset2); /* else last "if" handled it */
delta = (PyDateTime_Delta *)datetime_subtract((PyObject *)self,
other);
delta = (PyDateTime_Delta *)datetime_subtract(self, other);
if (delta == NULL)
goto done;
diff = GET_TD_DAYS(delta);
Expand Down
Loading