Fix ShellReadable.read method when resulting chunk is None

Change-Id: Iaac28fe7ab9e89898798977cbca2ed4813489d7c
This commit is contained in:
Federico Ressi 2021-07-07 09:47:16 +02:00
parent 0826bec368
commit 0ab38a8318
1 changed files with 1 additions and 3 deletions

View File

@ -88,7 +88,7 @@ class ShellReadable(ShellIOBase):
def read(self, size: int = None) -> bytes:
size = size or self.buffer_size
try:
chunk = self.delegate.read(size)
chunk: bytes = self.delegate.read(size) or b''
except IOError:
LOG.exception('Error reading from %r', self)
try:
@ -99,8 +99,6 @@ class ShellReadable(ShellIOBase):
if chunk:
self._data_chunks.append(chunk)
elif chunk is None:
chunk = 'b'
return chunk
@property