Skip to content

Commit 2e8417e

Browse files
[3.12] gh-106392: Fix inconsistency in deprecation warnings in datetime module (GH-114761) (#114767)
gh-106392: Fix inconsistency in deprecation warnings in datetime module (GH-114761) (cherry picked from commit dc4cd2c) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 4defc50 commit 2e8417e

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
@@ -1805,7 +1805,7 @@ def fromtimestamp(cls, timestamp, tz=None):
18051805
def utcfromtimestamp(cls, t):
18061806
"""Construct a naive UTC datetime from a POSIX timestamp."""
18071807
import warnings
1808-
warnings.warn("datetime.utcfromtimestamp() is deprecated and scheduled "
1808+
warnings.warn("datetime.datetime.utcfromtimestamp() is deprecated and scheduled "
18091809
"for removal in a future version. Use timezone-aware "
18101810
"objects to represent datetimes in UTC: "
18111811
"datetime.datetime.fromtimestamp(t, datetime.UTC).",
@@ -1823,8 +1823,8 @@ def now(cls, tz=None):
18231823
def utcnow(cls):
18241824
"Construct a UTC datetime from time.time()."
18251825
import warnings
1826-
warnings.warn("datetime.utcnow() is deprecated and scheduled for "
1827-
"removal in a future version. Instead, Use timezone-aware "
1826+
warnings.warn("datetime.datetime.utcnow() is deprecated and scheduled for "
1827+
"removal in a future version. Use timezone-aware "
18281828
"objects to represent datetimes in UTC: "
18291829
"datetime.datetime.now(datetime.UTC).",
18301830
DeprecationWarning,

0 commit comments

Comments
 (0)