1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-09 03:42:16 +03:00

config/linux.py Fix mypy complaints

This wasn't updated to note optionals when the parent base class was
This commit is contained in:
A_D 2022-12-23 17:49:07 +02:00
parent f6c6281ac2
commit 876afafcac
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -3,7 +3,7 @@ import os
import pathlib import pathlib
import sys import sys
from configparser import ConfigParser from configparser import ConfigParser
from typing import List, Optional, Union from typing import Any, List, Optional, Union
from config import AbstractConfig, appname, logger from config import AbstractConfig, appname, logger
@ -119,7 +119,7 @@ class LinuxConfig(AbstractConfig):
return self.config[self.SECTION].get(key) return self.config[self.SECTION].get(key)
def get_str(self, key: str, *, default: str = None) -> str: def get_str(self, key: str, *, default: str | None = None) -> str:
""" """
Return the string referred to by the given key if it exists, or the default. Return the string referred to by the given key if it exists, or the default.
@ -134,7 +134,7 @@ class LinuxConfig(AbstractConfig):
return self.__unescape(data) return self.__unescape(data)
def get_list(self, key: str, *, default: list = None) -> list: def get_list(self, key: str, *, default: list | None = None) -> list:
""" """
Return the list referred to by the given key if it exists, or the default. Return the list referred to by the given key if it exists, or the default.
@ -168,7 +168,7 @@ class LinuxConfig(AbstractConfig):
except ValueError as e: except ValueError as e:
raise ValueError(f'requested {key=} as int cannot be converted to int') from e raise ValueError(f'requested {key=} as int cannot be converted to int') from e
def get_bool(self, key: str, *, default: bool = None) -> bool: def get_bool(self, key: str, *, default: bool | None = None) -> bool:
""" """
Return the bool referred to by the given key if it exists, or the default. Return the bool referred to by the given key if it exists, or the default.