summaryrefslogtreecommitdiff
path: root/kvmd/plugins/msd/relay/drive.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-09-04 18:08:40 +0300
committerMaxim Devaev <[email protected]>2022-09-04 18:08:40 +0300
commitee3e224e396494cd0d69bb6167087a071a20349c (patch)
tree5becd28570e58a03c6e1e231d0db24c264a73f88 /kvmd/plugins/msd/relay/drive.py
parent4b75221e9470b4a009955d7677f16adf8e23e302 (diff)
new typing style
Diffstat (limited to 'kvmd/plugins/msd/relay/drive.py')
-rw-r--r--kvmd/plugins/msd/relay/drive.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/kvmd/plugins/msd/relay/drive.py b/kvmd/plugins/msd/relay/drive.py
index e1301f99..51a85392 100644
--- a/kvmd/plugins/msd/relay/drive.py
+++ b/kvmd/plugins/msd/relay/drive.py
@@ -27,7 +27,6 @@ import struct
import dataclasses
from typing import IO
-from typing import Optional
from .... import aiotools
from .... import aiofs
@@ -57,7 +56,7 @@ class ImageInfo:
complete: bool
@classmethod
- def from_bytes(cls, data: bytes) -> Optional["ImageInfo"]:
+ def from_bytes(cls, data: bytes) -> ("ImageInfo" | None):
try:
parsed = list(struct.unpack(_IMAGE_INFO_FORMAT, data))
except struct.error:
@@ -97,7 +96,7 @@ class DeviceInfo:
path: str
size: int
free: int
- image: Optional[ImageInfo]
+ image: (ImageInfo | None)
@classmethod
async def read(cls, device_path: str) -> "DeviceInfo":