Skip to content

Commit

Permalink
pythongh-106392: Fix inconsistency in deprecation warnings in datetim…
Browse files Browse the repository at this point in the history
…e module
  • Loading branch information
serhiy-storchaka committed Jan 30, 2024
1 parent fda7445 commit 5da2081
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 @@ -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,7 +1827,7 @@ 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 "
warnings.warn("datetime.datetime.utcnow() is deprecated and scheduled for "
"removal in a future version. Instead, Use timezone-aware "
"objects to represent datetimes in UTC: "
"datetime.datetime.now(datetime.UTC).",
Expand Down

0 comments on commit 5da2081

Please sign in to comment.