]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-103857: Update deprecation stacktrace to point to calling line (#104431)
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Fri, 12 May 2023 18:25:45 +0000 (21:25 +0300)
committerGitHub <noreply@github.com>
Fri, 12 May 2023 18:25:45 +0000 (22:25 +0400)
Misc/NEWS.d/next/Library/2023-05-12-19-29-28.gh-issue-103857.0IzSxr.rst [new file with mode: 0644]
Modules/_datetimemodule.c

diff --git a/Misc/NEWS.d/next/Library/2023-05-12-19-29-28.gh-issue-103857.0IzSxr.rst b/Misc/NEWS.d/next/Library/2023-05-12-19-29-28.gh-issue-103857.0IzSxr.rst
new file mode 100644 (file)
index 0000000..6e8162d
--- /dev/null
@@ -0,0 +1 @@
+Update datetime deprecations' stracktrace to point to the calling line
index 8f86fc91966205f2d09016c7f1fa9dfb54d714e5..8b417bdd0fb5b6475fae205ddea92880d13942a9 100644 (file)
@@ -5147,7 +5147,7 @@ datetime_utcnow(PyObject *cls, PyObject *dummy)
     if (PyErr_WarnEx(PyExc_DeprecationWarning,
         "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).", 2))
+        "in UTC: datetime.now(datetime.UTC).", 1))
     {
         return NULL;
     }
@@ -5190,7 +5190,7 @@ datetime_utcfromtimestamp(PyObject *cls, PyObject *args)
     if (PyErr_WarnEx(PyExc_DeprecationWarning,
         "datetime.utcfromtimestamp() is deprecated and scheduled for removal "
         "in a future version. Use timezone-aware objects to represent "
-        "datetimes in UTC: datetime.now(datetime.UTC).", 2))
+        "datetimes in UTC: datetime.now(datetime.UTC).", 1))
     {
         return NULL;
     }