Skip to content

Commit

Permalink
gh-106392: Fix inconsistency in deprecation warnings in datetime modu…
Browse files Browse the repository at this point in the history
…le (GH-114761)
  • Loading branch information
serhiy-storchaka authored Jan 30, 2024
1 parent 348a72c commit dc4cd2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/_pydatetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,7 @@ def fromtimestamp(cls, timestamp, tz=None):
def utcfromtimestamp(cls, t):
"""Construct a naive UTC datetime from a POSIX timestamp."""
import warnings
warnings.warn("datetime.utcfromtimestamp() is deprecated and scheduled "
warnings.warn("datetime.datetime.utcfromtimestamp() is deprecated and scheduled "
"for removal in a future version. Use timezone-aware "
"objects to represent datetimes in UTC: "
"datetime.datetime.fromtimestamp(t, datetime.UTC).",
Expand All @@ -1827,8 +1827,8 @@ def now(cls, tz=None):
def utcnow(cls):
"Construct a UTC datetime from time.time()."
import warnings
warnings.warn("datetime.utcnow() is deprecated and scheduled for "
"removal in a future version. Instead, Use timezone-aware "
warnings.warn("datetime.datetime.utcnow() is deprecated and scheduled for "
"removal in a future version. Use timezone-aware "
"objects to represent datetimes in UTC: "
"datetime.datetime.now(datetime.UTC).",
DeprecationWarning,
Expand Down

0 comments on commit dc4cd2c

Please sign in to comment.