Skip to content

Commit d5c5d4b

Browse files
authored
gh-106392: Fix inconsistency in deprecation warnings (#106436)
They used "datetime" to refer to both the object and the module.
1 parent 3b73f9f commit d5c5d4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/_pydatetime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ def utcfromtimestamp(cls, t):
18121812
warnings.warn("datetime.utcfromtimestamp() is deprecated and scheduled "
18131813
"for removal in a future version. Use timezone-aware "
18141814
"objects to represent datetimes in UTC: "
1815-
"datetime.fromtimestamp(t, datetime.UTC).",
1815+
"datetime.datetime.fromtimestamp(t, datetime.UTC).",
18161816
DeprecationWarning,
18171817
stacklevel=2)
18181818
return cls._fromtimestamp(t, True, None)
@@ -1830,7 +1830,7 @@ def utcnow(cls):
18301830
warnings.warn("datetime.utcnow() is deprecated and scheduled for "
18311831
"removal in a future version. Instead, Use timezone-aware "
18321832
"objects to represent datetimes in UTC: "
1833-
"datetime.now(datetime.UTC).",
1833+
"datetime.datetime.now(datetime.UTC).",
18341834
DeprecationWarning,
18351835
stacklevel=2)
18361836
t = _time.time()

0 commit comments

Comments
 (0)