diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2023-05-12 18:25:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-12 18:25:45 (GMT) |
commit | 25db95d224d18fb7b7f53165aeaa87632b0230f2 (patch) | |
tree | b785360aa3c2dd0246090f56af95009bee3cf3ac | |
parent | 590d7a527d43e4a50fcf74839e516ff7b869434f (diff) | |
download | cpython-25db95d224d18fb7b7f53165aeaa87632b0230f2.zip cpython-25db95d224d18fb7b7f53165aeaa87632b0230f2.tar.gz cpython-25db95d224d18fb7b7f53165aeaa87632b0230f2.tar.bz2 |
gh-103857: Update deprecation stacktrace to point to calling line (#104431)
-rw-r--r-- | Misc/NEWS.d/next/Library/2023-05-12-19-29-28.gh-issue-103857.0IzSxr.rst | 1 | ||||
-rw-r--r-- | Modules/_datetimemodule.c | 4 |
2 files changed, 3 insertions, 2 deletions
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 index 0000000..6e8162d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-05-12-19-29-28.gh-issue-103857.0IzSxr.rst @@ -0,0 +1 @@ +Update datetime deprecations' stracktrace to point to the calling line diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 8f86fc9..8b417bd 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -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; } |