diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3768e55..b2a730f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.4 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/src/androidtvremote2/androidtv_remote.py b/src/androidtvremote2/androidtv_remote.py index ff0e4be..d7b53ff 100644 --- a/src/androidtvremote2/androidtv_remote.py +++ b/src/androidtvremote2/androidtv_remote.py @@ -3,12 +3,12 @@ from __future__ import annotations import asyncio -import os import ssl from typing import TYPE_CHECKING from urllib.parse import urlparse import aiofiles +from aiofiles import os as aos from cryptography import x509 from .certificate_generator import generate_selfsigned_cert @@ -189,7 +189,7 @@ async def async_generate_cert_if_missing(self) -> bool: :returns: True if a new certificate was generated. """ - if os.path.isfile(self._certfile) and os.path.isfile(self._keyfile): + if await aos.path.isfile(self._certfile) and await aos.path.isfile(self._keyfile): return False cert_pem, key_pem = generate_selfsigned_cert(self._client_name) async with aiofiles.open(self._certfile, "w", encoding="utf-8") as out: diff --git a/src/demo.py b/src/demo.py index 34604c6..2d0d129 100644 --- a/src/demo.py +++ b/src/demo.py @@ -1,4 +1,4 @@ -# ruff: noqa: T201, PLR0912, PLR0915 +# ruff: noqa: T201, PLR0912, PLR0915, ASYNC240, ASYNC250 """Demo usage of AndroidTVRemote.""" import argparse