diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-09-02 21:44:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 21:44:28 (GMT) |
commit | b862c25922764eb7bb3cd93dc91fd15c8e92d4f2 (patch) | |
tree | 70b0bc39f893879598d7f5a0210386e4fe0b7cd8 | |
parent | 70a378c88871b1cfac56cfdecde31a4adaac929a (diff) | |
download | cpython-b862c25922764eb7bb3cd93dc91fd15c8e92d4f2.zip cpython-b862c25922764eb7bb3cd93dc91fd15c8e92d4f2.tar.gz cpython-b862c25922764eb7bb3cd93dc91fd15c8e92d4f2.tar.bz2 |
[3.12] gh-106392: Fix inconsistency in deprecation warnings (GH-106436) (#108792)
gh-106392: Fix inconsistency in deprecation warnings (GH-106436)
They used "datetime" to refer to both the object and the module.
(cherry picked from commit d5c5d4bfd3260219397326795d3b2ff62a9ab8cb)
Co-authored-by: William Andrea <william.j.andrea@gmail.com>
-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() |