mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-106392: Fix inconsistency in deprecation warnings (#106436)
They used "datetime" to refer to both the object and the module.
This commit is contained in:
parent
3b73f9f00e
commit
d5c5d4bfd3
1 changed files with 2 additions and 2 deletions
|
@ -1812,7 +1812,7 @@ class datetime(date):
|
|||
warnings.warn("datetime.utcfromtimestamp() is deprecated and scheduled "
|
||||
"for removal in a future version. Use timezone-aware "
|
||||
"objects to represent datetimes in UTC: "
|
||||
"datetime.fromtimestamp(t, datetime.UTC).",
|
||||
"datetime.datetime.fromtimestamp(t, datetime.UTC).",
|
||||
DeprecationWarning,
|
||||
stacklevel=2)
|
||||
return cls._fromtimestamp(t, True, None)
|
||||
|
@ -1830,7 +1830,7 @@ class datetime(date):
|
|||
warnings.warn("datetime.utcnow() is deprecated and scheduled for "
|
||||
"removal in a future version. Instead, Use timezone-aware "
|
||||
"objects to represent datetimes in UTC: "
|
||||
"datetime.now(datetime.UTC).",
|
||||
"datetime.datetime.now(datetime.UTC).",
|
||||
DeprecationWarning,
|
||||
stacklevel=2)
|
||||
t = _time.time()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue