예제 #1
0
    def __init__(self, stream):
        # duck-type instead of checking inheritance from IOBase.
        # At the least, stream must have read()
        if not callable(getattr(stream, 'read', None)):
            raise TypeError('I/O stream type expected')
        assert not isinstance(stream, InputStream)

        super().__init__()
        self._stream = stream
        self._binding = _awscrt.input_stream_new(self)
예제 #2
0
파일: io.py 프로젝트: lipi/aws-crt-python
    def __init__(self, stream):
        assert isinstance(stream, io.IOBase)
        assert not isinstance(stream, InputStream)

        super(InputStream, self).__init__()
        self._binding = _awscrt.input_stream_new(stream)