MCPcopy Index your code
hub / github.com/python/cpython / __calc_timezone

Method __calc_timezone

Lib/_strptime.py:322–337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

320 return None, None
321
322 def __calc_timezone(self):
323 # Set self.timezone by using time.tzname.
324 # Do not worry about possibility of time.tzname[0] == time.tzname[1]
325 # and time.daylight; handle that in strptime.
326 try:
327 time.tzset()
328 except AttributeError:
329 pass
330 self.tzname = time.tzname
331 self.daylight = time.daylight
332 no_saving = frozenset({"utc", "gmt", self.tzname[0].lower()})
333 if self.daylight:
334 has_saving = frozenset({self.tzname[1].lower()})
335 else:
336 has_saving = frozenset()
337 self.timezone = (no_saving, has_saving)
338
339
340class TimeRE(dict):

Callers 1

__init__Method · 0.95

Calls 1

lowerMethod · 0.45

Tested by

no test coverage detected