]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clarify distinction between datetime module and class in deprecation messages (GH...
authorClément Robert <cr52@protonmail.com>
Sun, 27 Aug 2023 13:09:40 +0000 (15:09 +0200)
committerGitHub <noreply@github.com>
Sun, 27 Aug 2023 13:09:40 +0000 (16:09 +0300)
Modules/_datetimemodule.c

index 454be6efc09d35510974021f90b691aa9d2b62c9..191db3f84088d5f310cbcbcd5ef560ea9b196067 100644 (file)
@@ -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;
     }
@@ -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;
     }