Skip to content

Commit

Permalink
gh-106392: Fix inconsistency in deprecation warnings (#106436)
Browse files Browse the repository at this point in the history
They used "datetime" to refer to both the object and the module.
  • Loading branch information
wjandrea authored Sep 1, 2023
1 parent 3b73f9f commit d5c5d4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/_pydatetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ def utcfromtimestamp(cls, t):
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)
Expand All @@ -1830,7 +1830,7 @@ def utcnow(cls):
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()
Expand Down

0 comments on commit d5c5d4b

Please sign in to comment.