Skip to content

Commit 07c0e24

Browse files
[3.12] Clarify distinction between datetime module and class in deprecation messages (GH-108073) (#108540)
Clarify distinction between datetime module and class in deprecation messages (GH-108073) (cherry picked from commit 09343db) Co-authored-by: Clément Robert <[email protected]>
1 parent 0b0238d commit 07c0e24

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
@@ -5145,9 +5145,9 @@ static PyObject *
51455145
datetime_utcnow(PyObject *cls, PyObject *dummy)
51465146
{
51475147
if (PyErr_WarnEx(PyExc_DeprecationWarning,
5148-
"datetime.utcnow() is deprecated and scheduled for removal in a "
5148+
"datetime.datetime.utcnow() is deprecated and scheduled for removal in a "
51495149
"future version. Use timezone-aware objects to represent datetimes "
5150-
"in UTC: datetime.now(datetime.UTC).", 1))
5150+
"in UTC: datetime.datetime.now(datetime.UTC).", 1))
51515151
{
51525152
return NULL;
51535153
}
@@ -5188,9 +5188,9 @@ static PyObject *
51885188
datetime_utcfromtimestamp(PyObject *cls, PyObject *args)
51895189
{
51905190
if (PyErr_WarnEx(PyExc_DeprecationWarning,
5191-
"datetime.utcfromtimestamp() is deprecated and scheduled for removal "
5191+
"datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal "
51925192
"in a future version. Use timezone-aware objects to represent "
5193-
"datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC).", 1))
5193+
"datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).", 1))
51945194
{
51955195
return NULL;
51965196
}

0 commit comments

Comments
 (0)