Skip to content

Commit 84b4805

Browse files
committed
jadepy: return empty bytes if asked to read 0 bytes
The CBOR parser appears to ask for 0 bytes when parsing on occasion.
1 parent 695fa05 commit 84b4805

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

jadepy/jade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,7 @@ def read(self, n):
23132313
The bytes received
23142314
"""
23152315
# logger.debug(f'Reading {n} bytes...')
2316-
bytes_ = self.impl.read(n)
2316+
bytes_ = self.impl.read(n) if n else bytes()
23172317
# logger.debug(f'Received: {len(bytes_)} bytes')
23182318
return bytes_
23192319

0 commit comments

Comments
 (0)