mirror of https://github.com/python/cpython
gh-103857: Update deprecation stacktrace to point to calling line (#104431)
This commit is contained in:
parent
590d7a527d
commit
25db95d224
|
@ -0,0 +1 @@
|
|||
Update datetime deprecations' stracktrace to point to the calling line
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue