From 2e8417eec4c33e7952808357ffc38357c71aa8fc Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Wed, 31 Jan 2024 04:24:27 +0100 Subject: [PATCH] [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 dc4cd2c9ba60e2ee7e534e2f6e93c4c135df23b9) Co-authored-by: Serhiy Storchaka --- Lib/_pydatetime.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/_pydatetime.py b/Lib/_pydatetime.py index 0e34d8aacf531d..cd0ea900bfb9b4 100644 --- a/Lib/_pydatetime.py +++ b/Lib/_pydatetime.py @@ -1805,7 +1805,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).", @@ -1823,8 +1823,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,