Skip to content

Commit 09343db

Browse files
Clarify distinction between datetime module and class in deprecation messages (GH-108073)
1 parent cd0a8ae commit 09343db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/_datetimemodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5136,9 +5136,9 @@ static PyObject *
51365136
datetime_utcnow(PyObject *cls, PyObject *dummy)
51375137
{
51385138
if (PyErr_WarnEx(PyExc_DeprecationWarning,
5139-
"datetime.utcnow() is deprecated and scheduled for removal in a "
5139+
"datetime.datetime.utcnow() is deprecated and scheduled for removal in a "
51405140
"future version. Use timezone-aware objects to represent datetimes "
5141-
"in UTC: datetime.now(datetime.UTC).", 1))
5141+
"in UTC: datetime.datetime.now(datetime.UTC).", 1))
51425142
{
51435143
return NULL;
51445144
}
@@ -5179,9 +5179,9 @@ static PyObject *
51795179
datetime_utcfromtimestamp(PyObject *cls, PyObject *args)
51805180
{
51815181
if (PyErr_WarnEx(PyExc_DeprecationWarning,
5182-
"datetime.utcfromtimestamp() is deprecated and scheduled for removal "
5182+
"datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal "
51835183
"in a future version. Use timezone-aware objects to represent "
5184-
"datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC).", 1))
5184+
"datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).", 1))
51855185
{
51865186
return NULL;
51875187
}

0 commit comments

Comments
 (0)