From: OzGav Date: Mon, 12 Jan 2026 13:37:04 +0000 (+1000) Subject: Add PTH107 mypy rule (#2933) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=f1e35bad577a7bb9172bccc5c059db6b54475f22;p=music-assistant-server.git Add PTH107 mypy rule (#2933) --- diff --git a/music_assistant/helpers/named_pipe.py b/music_assistant/helpers/named_pipe.py index 7c9e1b30..ac26ddb5 100644 --- a/music_assistant/helpers/named_pipe.py +++ b/music_assistant/helpers/named_pipe.py @@ -6,6 +6,7 @@ import asyncio import os import stat from contextlib import suppress +from pathlib import Path class AsyncNamedPipeWriter: @@ -35,7 +36,7 @@ class AsyncNamedPipeWriter: file_stat = os.stat(self._pipe_path) if not stat.S_ISFIFO(file_stat.st_mode): # Not a FIFO - remove and recreate - os.remove(self._pipe_path) + Path(self._pipe_path).unlink() os.mkfifo(self._pipe_path) await asyncio.to_thread(_create) @@ -55,7 +56,7 @@ class AsyncNamedPipeWriter: def _remove() -> None: with suppress(Exception): - os.remove(self._pipe_path) + Path(self._pipe_path).unlink() await asyncio.to_thread(_remove) diff --git a/pyproject.toml b/pyproject.toml index d79a2842..140e177f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -245,7 +245,6 @@ ignore = [ "RET507", "RUF006", "TRY300", - "PTH107", "S608", "N818", "S307",