update
This commit is contained in:
18
.CondaPkg/env/Lib/_pydatetime.py
vendored
18
.CondaPkg/env/Lib/_pydatetime.py
vendored
@@ -970,6 +970,8 @@ class date:
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t):
|
||||
"Construct a date from a POSIX timestamp (like time.time())."
|
||||
if t is None:
|
||||
raise TypeError("'NoneType' object cannot be interpreted as an integer")
|
||||
y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)
|
||||
return cls(y, m, d)
|
||||
|
||||
@@ -1015,13 +1017,9 @@ class date:
|
||||
def __repr__(self):
|
||||
"""Convert to formal string, for repr().
|
||||
|
||||
>>> dt = datetime(2010, 1, 1)
|
||||
>>> repr(dt)
|
||||
'datetime.datetime(2010, 1, 1, 0, 0)'
|
||||
|
||||
>>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
|
||||
>>> repr(dt)
|
||||
'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
|
||||
>>> d = date(2010, 1, 1)
|
||||
>>> repr(d)
|
||||
'datetime.date(2010, 1, 1)'
|
||||
"""
|
||||
return "%s.%s(%d, %d, %d)" % (_get_class_module(self),
|
||||
self.__class__.__qualname__,
|
||||
@@ -1809,7 +1807,7 @@ class datetime(date):
|
||||
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 +1825,8 @@ class datetime(date):
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user