Skip to content

Commit

Permalink
gh-103857: Update deprecation stacktrace to point to calling line (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed May 12, 2023
1 parent 590d7a5 commit 25db95d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update datetime deprecations' stracktrace to point to the calling line
4 changes: 2 additions & 2 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 25db95d

Please sign in to comment.