gh-103857: Update deprecation stacktrace to point to calling line (#104431)

This commit is contained in:
Hugo van Kemenade 2023-05-12 21:25:45 +03:00 committed by GitHub
parent 590d7a527d
commit 25db95d224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
Update datetime deprecations' stracktrace to point to the calling line

View 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;
}