mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 01:51:53 +08:00
lint fixes
This commit is contained in:
@@ -94,8 +94,7 @@ class BaseMsd(BasePlugin):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def poll_state(self) -> AsyncGenerator[Dict, None]:
|
||||
if True: # pylint: disable=using-constant-test
|
||||
# XXX: Vulture hack
|
||||
if self is not None: # XXX: Vulture and pylint hack
|
||||
raise NotImplementedError()
|
||||
yield
|
||||
|
||||
@@ -117,9 +116,8 @@ class BaseMsd(BasePlugin):
|
||||
raise NotImplementedError()
|
||||
|
||||
@contextlib.asynccontextmanager
|
||||
async def write_image(self, name: str) -> AsyncGenerator[None, None]:
|
||||
if True: # pylint: disable=using-constant-test
|
||||
# XXX: Vulture hack
|
||||
async def write_image(self, name: str) -> AsyncGenerator[None, None]: # pylint: disable=unused-argument
|
||||
if self is not None: # XXX: Vulture and pylint hack
|
||||
raise NotImplementedError()
|
||||
yield
|
||||
|
||||
|
||||
@@ -74,8 +74,7 @@ class Plugin(BaseMsd):
|
||||
|
||||
@contextlib.asynccontextmanager
|
||||
async def write_image(self, name: str) -> AsyncGenerator[None, None]:
|
||||
if True: # pylint: disable=using-constant-test
|
||||
# XXX: Vulture hack
|
||||
if self is not None: # XXX: Vulture and pylint hack
|
||||
raise MsdDisabledError()
|
||||
yield
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ def _parse_image_info_bytes(data: bytes) -> Optional[_ImageInfo]:
|
||||
|
||||
def _ioctl_uint32(device_file: IO, request: int) -> int:
|
||||
buf = b"\0" * 4
|
||||
buf = fcntl.ioctl(device_file.fileno(), request, buf)
|
||||
buf = fcntl.ioctl(device_file.fileno(), request, buf) # type: ignore
|
||||
result = struct.unpack("I", buf)[0]
|
||||
assert result > 0, (device_file, request, buf)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user