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)

(cherry picked from commit 09343db)

Co-authored-by: Clément Robert <[email protected]>
  • Loading branch information
neutrinoceros authored and miss-islington committed Aug 27, 2023
1 parent 3e20303 commit 8990f89
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 @@ -5145,9 +5145,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 @@ -5188,9 +5188,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 8990f89

Please sign in to comment.