From 34181d2e0982f53e24e2c79694a8aee50b25d0d9 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Thu, 16 Oct 2025 08:02:35 -0700 Subject: [PATCH] update fixes --- src/ytdl_sub/config/defaults.py | 2 ++ src/ytdl_sub/script/utils/type_checking.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ytdl_sub/config/defaults.py b/src/ytdl_sub/config/defaults.py index cf1f3096..e0746e1e 100644 --- a/src/ytdl_sub/config/defaults.py +++ b/src/ytdl_sub/config/defaults.py @@ -2,6 +2,8 @@ import os from ytdl_sub.utils.system import IS_WINDOWS +# pylint: disable=invalid-name + def _existing_path(*paths: str) -> str: """ diff --git a/src/ytdl_sub/script/utils/type_checking.py b/src/ytdl_sub/script/utils/type_checking.py index e8a8bc79..7598a526 100644 --- a/src/ytdl_sub/script/utils/type_checking.py +++ b/src/ytdl_sub/script/utils/type_checking.py @@ -2,6 +2,7 @@ import inspect from dataclasses import dataclass from inspect import FullArgSpec +from types import NoneType from typing import Callable from typing import List from typing import Optional @@ -50,7 +51,7 @@ def get_optional_type(optional_type: Type) -> Type[NamedType]: ------- Type within the Optional[Type] """ - return [arg for arg in optional_type.__args__ if arg != type(None)][0] + return [arg for arg in optional_type.__args__ if not isinstance(arg, NoneType)][0] def _is_union_compatible(