Skip to content

Commit 77b6801

Browse files
committed
Fix examples
1 parent 904011a commit 77b6801

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/includes/tzinfo_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class LocalTimezone(dt.tzinfo):
2323

2424
def fromutc(self, when):
25-
assert dt.tzinfo is self
25+
assert when.tzinfo is self
2626
stamp = (when - dt.datetime(1970, 1, 1, tzinfo=self)) // SECOND
2727
args = _time.localtime(stamp)[:6]
2828
dst_diff = DSTDIFF // SECOND
@@ -142,7 +142,7 @@ def dst(self, when):
142142
# Can't compare naive to aware objects, so strip the timezone from
143143
# when first.
144144
when = when.replace(tzinfo=None)
145-
if start + HOUR <= dt < end - HOUR:
145+
if start + HOUR <= when < end - HOUR:
146146
# DST is in effect.
147147
return HOUR
148148
if end - HOUR <= when < end:

0 commit comments

Comments
 (0)