Skip to content

Commit

Permalink
chore: Remove from __future__ import annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpelsepp committed Dec 18, 2024
1 parent 5d1d222 commit 44893c7
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 154 deletions.
2 changes: 0 additions & 2 deletions src/gallia/cli/cursed_hr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

import curses
import curses.ascii
import gzip
Expand Down
6 changes: 2 additions & 4 deletions src/gallia/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

import atexit
import dataclasses
import datetime
Expand Down Expand Up @@ -153,7 +151,7 @@ class PenlogPriority(IntEnum):
TRACE = 8

@classmethod
def from_str(cls, string: str) -> PenlogPriority:
def from_str(cls, string: str) -> "PenlogPriority":
"""Converts a string to an instance of PenlogPriority.
``string`` can be a numeric value (0 to 8 inclusive)
or a string with a case insensitive name of the level
Expand Down Expand Up @@ -185,7 +183,7 @@ def from_str(cls, string: str) -> PenlogPriority:
raise ValueError(f"{string} not a valid priority")

@classmethod
def from_level(cls, value: int) -> PenlogPriority:
def from_level(cls, value: int) -> "PenlogPriority":
"""Converts an int value (e.g. from python's logging module)
to an instance of this class.
"""
Expand Down
2 changes: 0 additions & 2 deletions src/gallia/services/uds/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

import asyncio
import struct
from collections.abc import Sequence
Expand Down
6 changes: 2 additions & 4 deletions src/gallia/services/uds/core/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

import asyncio
from abc import ABC
from typing import Any
Expand Down Expand Up @@ -72,7 +70,7 @@ class UnexpectedResponse(ResponseException):

class UnexpectedNegativeResponse(UnexpectedResponse, ABC):
RESPONSE_CODE: UDSErrorCodes
_CONCRETE_EXCEPTIONS: dict[UDSErrorCodes | None, type[UnexpectedNegativeResponse]] = {}
_CONCRETE_EXCEPTIONS: dict[UDSErrorCodes | None, type["UnexpectedNegativeResponse"]] = {}

def __init_subclass__(cls, /, response_code: UDSErrorCodes, **kwargs: Any) -> None:
super().__init_subclass__(**kwargs)
Expand All @@ -93,7 +91,7 @@ def __init__(
@staticmethod
def parse_dynamic(
request: UDSRequest, response: NegativeResponse, message: str | None = None
) -> UnexpectedNegativeResponse:
) -> "UnexpectedNegativeResponse":
return UnexpectedNegativeResponse._CONCRETE_EXCEPTIONS[response.response_code](
request, response, message
)
Expand Down
Loading

0 comments on commit 44893c7

Please sign in to comment.