MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _check_utc_offset

Function _check_utc_offset

tools/python-3.11.9-amd64/Lib/datetime.py:503–513  ·  view source on GitHub ↗
(name, offset)

Source from the content-addressed store, hash-verified

501# Else offset is checked for being in range.
502# If it is, its integer value is returned. Else ValueError is raised.
503def _check_utc_offset(name, offset):
504 assert name in ("utcoffset", "dst")
505 if offset is None:
506 return
507 if not isinstance(offset, timedelta):
508 raise TypeError("tzinfo.%s() must return None "
509 "or timedelta, not '%s'" % (name, type(offset)))
510 if not -timedelta(1) < offset < timedelta(1):
511 raise ValueError("%s()=%s, must be strictly between "
512 "-timedelta(hours=24) and timedelta(hours=24)" %
513 (name, offset))
514
515def _check_date_fields(year, month, day):
516 year = _index(year)

Callers 4

utcoffsetMethod · 0.85
dstMethod · 0.85
utcoffsetMethod · 0.85
dstMethod · 0.85

Calls 2

timedeltaClass · 0.85
typeClass · 0.50

Tested by

no test coverage detected