Skip to content

Commit 754d854

Browse files
committed
_time -> time
1 parent 77b6801 commit 754d854

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Doc/includes/tzinfo_examples.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
# (May result in wrong values on historical times in
55
# timezones where UTC offset and/or the DST rules had
66
# changed in the past.)
7-
import time as _time
7+
import time
88

99
ZERO = dt.timedelta(0)
1010
HOUR = dt.timedelta(hours=1)
1111
SECOND = dt.timedelta(seconds=1)
1212

13-
STDOFFSET = dt.timedelta(seconds=-_time.timezone)
14-
if _time.daylight:
15-
DSTOFFSET = dt.timedelta(seconds=-_time.altzone)
13+
STDOFFSET = dt.timedelta(seconds=-time.timezone)
14+
if time.daylight:
15+
DSTOFFSET = dt.timedelta(seconds=-time.altzone)
1616
else:
1717
DSTOFFSET = STDOFFSET
1818

@@ -24,10 +24,10 @@ class LocalTimezone(dt.tzinfo):
2424
def fromutc(self, when):
2525
assert when.tzinfo is self
2626
stamp = (when - dt.datetime(1970, 1, 1, tzinfo=self)) // SECOND
27-
args = _time.localtime(stamp)[:6]
27+
args = time.localtime(stamp)[:6]
2828
dst_diff = DSTDIFF // SECOND
2929
# Detect fold
30-
fold = (args == _time.localtime(stamp - dst_diff))
30+
fold = (args == time.localtime(stamp - dst_diff))
3131
return dt.datetime(*args, microsecond=when.microsecond,
3232
tzinfo=self, fold=fold)
3333

@@ -44,14 +44,14 @@ def dst(self, when):
4444
return ZERO
4545

4646
def tzname(self, when):
47-
return _time.tzname[self._isdst(when)]
47+
return time.tzname[self._isdst(when)]
4848

4949
def _isdst(self, when):
5050
tt = (when.year, when.month, when.day,
5151
when.hour, when.minute, when.second,
5252
when.weekday(), 0, 0)
53-
stamp = _time.mktime(tt)
54-
tt = _time.localtime(stamp)
53+
stamp = time.mktime(tt)
54+
tt = time.localtime(stamp)
5555
return tt.tm_isdst > 0
5656

5757

0 commit comments

Comments
 (0)