diff options
author | William Andrea <william.j.andrea@gmail.com> | 2023-09-01 22:31:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-01 22:31:21 (GMT) |
commit | d5c5d4bfd3260219397326795d3b2ff62a9ab8cb (patch) | |
tree | 605d901a85e0fc9799365544406d2373cce34b25 /Lib/_pydatetime.py | |
parent | 3b73f9f00e44d6b709fa27f83d64d7355e1891ca (diff) | |
download | cpython-d5c5d4bfd3260219397326795d3b2ff62a9ab8cb.zip cpython-d5c5d4bfd3260219397326795d3b2ff62a9ab8cb.tar.gz cpython-d5c5d4bfd3260219397326795d3b2ff62a9ab8cb.tar.bz2 |
gh-106392: Fix inconsistency in deprecation warnings (#106436)
They used "datetime" to refer to both the object and the module.
Diffstat (limited to 'Lib/_pydatetime.py')
-rw-r--r-- | Lib/_pydatetime.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/_pydatetime.py b/Lib/_pydatetime.py index f4fc2c5..549fcda 100644 --- a/Lib/_pydatetime.py +++ b/Lib/_pydatetime.py @@ -1812,7 +1812,7 @@ class datetime(date): warnings.warn("datetime.utcfromtimestamp() is deprecated and scheduled " "for removal in a future version. Use timezone-aware " "objects to represent datetimes in UTC: " - "datetime.fromtimestamp(t, datetime.UTC).", + "datetime.datetime.fromtimestamp(t, datetime.UTC).", DeprecationWarning, stacklevel=2) return cls._fromtimestamp(t, True, None) @@ -1830,7 +1830,7 @@ class datetime(date): warnings.warn("datetime.utcnow() is deprecated and scheduled for " "removal in a future version. Instead, Use timezone-aware " "objects to represent datetimes in UTC: " - "datetime.now(datetime.UTC).", + "datetime.datetime.now(datetime.UTC).", DeprecationWarning, stacklevel=2) t = _time.time() |