Allow sending no payload
This commit is contained in:
parent
bcff2a7fb6
commit
acdc41bd03
1 changed files with 4 additions and 1 deletions
|
|
@ -621,7 +621,10 @@ def clear(self) -> None:
|
|||
defval: Union[str, None, int] = getattr(GraphicsCommand, k)
|
||||
setattr(self, k, defval)
|
||||
|
||||
def iter_transmission_chunks(self, data: bytes, level: int = -1, compression_threshold: int = 1024) -> Iterator[bytes]:
|
||||
def iter_transmission_chunks(self, data: Optional[bytes] = None, level: int = -1, compression_threshold: int = 1024) -> Iterator[bytes]:
|
||||
if data is None:
|
||||
yield self.serialize()
|
||||
return
|
||||
gc = self.clone()
|
||||
gc.S = len(data)
|
||||
if level and len(data) >= compression_threshold:
|
||||
|
|
|
|||
Loading…
Reference in a new issue