https://github.com/python/cpython/commit/dc4cd2c9ba60e2ee7e534e2f6e93c4c135df23b9
commit: dc4cd2c9ba60e2ee7e534e2f6e93c4c135df23b9
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-01-30T22:15:33Z
summary:
gh-106392: Fix inconsistency in deprecation warnings in datetime module
(GH-114761)
files:
M Lib/_pydatetime.py
diff --git a/Lib/_pydatetime.py b/Lib/_pydatetime.py
index 355145387e355b..54c12d3b2f3f16 100644
--- a/Lib/_pydatetime.py
+++ b/Lib/_pydatetime.py
@@ -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).",
@@ -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,
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]