Skip to content

Commit

Permalink
Clarify distinction between datetime module and class in deprecation …
Browse files Browse the repository at this point in the history
…messages (pythonGH-108073)
  • Loading branch information
neutrinoceros authored Aug 27, 2023
1 parent cd0a8ae commit 09343db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -5136,9 +5136,9 @@ static PyObject *
datetime_utcnow(PyObject *cls, PyObject *dummy)
{
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"datetime.utcnow() is deprecated and scheduled for removal in a "
"datetime.datetime.utcnow() is deprecated and scheduled for removal in a "
"future version. Use timezone-aware objects to represent datetimes "
"in UTC: datetime.now(datetime.UTC).", 1))
"in UTC: datetime.datetime.now(datetime.UTC).", 1))
{
return NULL;
}
Expand Down Expand Up @@ -5179,9 +5179,9 @@ static PyObject *
datetime_utcfromtimestamp(PyObject *cls, PyObject *args)
{
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"datetime.utcfromtimestamp() is deprecated and scheduled for removal "
"datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal "
"in a future version. Use timezone-aware objects to represent "
"datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC).", 1))
"datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).", 1))
{
return NULL;
}
Expand Down

0 comments on commit 09343db

Please sign in to comment.