MCPcopy Create free account
hub / github.com/dateutil/dateutil / ReadOnly

Class ReadOnly

tests/test_tzfile.py:1558–1563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1556 """A zone can be read from an object that only has a read() method."""
1557
1558 class ReadOnly:
1559 def __init__(self, data):
1560 self._stream = io.BytesIO(data)
1561
1562 def read(self, *args):
1563 return self._stream.read(*args)
1564
1565 data = _zone_for_stream_tests()
1566 zone = tz.tzfile(ReadOnly(data), filename="read-only")

Callers 1

Calls

no outgoing calls

Tested by 1