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
Slimming as per Benedikt
  • Loading branch information
StanFromIreland committed Mar 12, 2025
commit cf5c7c87e1fea4e9a74845467afd8cf208a73f12
25 changes: 10 additions & 15 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3274,22 +3274,17 @@ date_today(PyObject *cls, PyObject *Py_UNUSED(dummy))
tm.tm_mday,
(PyTypeObject*)cls);
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated
}
else {
PyObject *time;
PyObject *result;
time = time_time();
if (time == NULL) {
return NULL;
}

/* Note well: today() is a class method, so this may not call
* date.fromtimestamp. For example, it may call
* datetime.fromtimestamp.
*/
result = PyObject_CallMethodOneArg(cls, &_Py_ID(fromtimestamp), time);
Py_DECREF(time);
return result;
PyObject *time = time_time();
Comment thread
StanFromIreland marked this conversation as resolved.
if (time == NULL) {
return NULL;
}

/* Note well: since today() is a class method, it may not call
* date.fromtimestamp, e.g., it may call datetime.fromtimestamp.
*/
PyObject *result = PyObject_CallMethodOneArg(cls, &_Py_ID(fromtimestamp), time);
Py_DECREF(time);
return result;
}

/*[clinic input]
Expand Down