From 016510aec3156061fccc8d9ebeee3710e76c8b79 Mon Sep 17 00:00:00 2001 From: Joel Ray Holveck Date: Thu, 17 Sep 2026 19:04:31 -0700 Subject: [PATCH] Add fixes for new Ruff rule RUF036 This new rule is "`None` not at the end of the type union." --- src/mss/base.py | 2 +- src/mss/linux/xlib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mss/base.py b/src/mss/base.py index dd3a175e..91a9dc12 100644 --- a/src/mss/base.py +++ b/src/mss/base.py @@ -208,7 +208,7 @@ def __init__( backend: str = "default", compression_level: int = 6, with_cursor: bool | _PlatformSpecific = _PD_WITH_CURSOR, - display: bytes | str | None | _PlatformSpecific = _PD_DISPLAY, + display: bytes | str | _PlatformSpecific | None = _PD_DISPLAY, max_displays: int | _PlatformSpecific = _PD_MAX_DISPLAYS, ) -> None: impl_kwargs = {} diff --git a/src/mss/linux/xlib.py b/src/mss/linux/xlib.py index fda0e703..0e13030a 100644 --- a/src/mss/linux/xlib.py +++ b/src/mss/linux/xlib.py @@ -331,7 +331,7 @@ def _error_handler(display: Display, event: XErrorEvent) -> int: def _validate_x11( - retval: _Pointer | None | XBool | XStatus | XID | int, func: Any, args: tuple[Any, Any], / + retval: _Pointer | XBool | XStatus | XID | int | None, func: Any, args: tuple[Any, Any], / ) -> tuple[Any, Any]: thread = current_thread()