Skip to content

Commit a0ee17e

Browse files
committed
pythongh-106392: Fix consistency in pydatetime error messages
Previously python#106436 fixed consistency within the suggested replacement, but not in the entire message
1 parent a768e12 commit a0ee17e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/_pydatetime.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,7 @@ def fromtimestamp(cls, timestamp, tz=None):
18091809
def utcfromtimestamp(cls, t):
18101810
"""Construct a naive UTC datetime from a POSIX timestamp."""
18111811
import warnings
1812-
warnings.warn("datetime.utcfromtimestamp() is deprecated and scheduled "
1812+
warnings.warn("datetime.datetime.utcfromtimestamp() is deprecated and scheduled "
18131813
"for removal in a future version. Use timezone-aware "
18141814
"objects to represent datetimes in UTC: "
18151815
"datetime.datetime.fromtimestamp(t, datetime.UTC).",
@@ -1827,8 +1827,8 @@ def now(cls, tz=None):
18271827
def utcnow(cls):
18281828
"Construct a UTC datetime from time.time()."
18291829
import warnings
1830-
warnings.warn("datetime.utcnow() is deprecated and scheduled for "
1831-
"removal in a future version. Instead, Use timezone-aware "
1830+
warnings.warn("datetime.datetime.utcnow() is deprecated and scheduled for "
1831+
"removal in a future version. Use timezone-aware "
18321832
"objects to represent datetimes in UTC: "
18331833
"datetime.datetime.now(datetime.UTC).",
18341834
DeprecationWarning,

0 commit comments

Comments
 (0)