Skip to content

Commit f67edf2

Browse files
authored
Merge pull request #104 from ImogenBits/safe_error
Safer error messages
2 parents ed218d0 + 6be2387 commit f67edf2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

algobattle/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pathlib import Path
99
from tempfile import TemporaryDirectory
1010
from traceback import format_exception
11-
from typing import Any, Iterable, Literal, TypeVar, Self
11+
from typing import Any, Iterable, Literal, LiteralString, TypeVar, Self
1212

1313
from pydantic import BaseConfig, BaseModel as PydandticBaseModel, Extra, ValidationError as PydanticValidationError
1414

@@ -187,7 +187,7 @@ def flat_intersperse(iterable: Iterable[Iterable[T]], element: T) -> Iterable[T]
187187
class AlgobattleBaseException(Exception):
188188
"""Base exception class for errors used by the algobattle package."""
189189

190-
def __init__(self, message: str, *, detail: str | None = None) -> None:
190+
def __init__(self, message: LiteralString, *, detail: str | None = None) -> None:
191191
"""Base exception class for errors used by the algobattle package.
192192
193193
Args:
@@ -214,7 +214,7 @@ class BuildError(AlgobattleBaseException):
214214
class ExecutionError(AlgobattleBaseException):
215215
"""Indicates that the program could not be executed successfully."""
216216

217-
def __init__(self, message: str, *, detail: str | None = None, runtime: float) -> None:
217+
def __init__(self, message: LiteralString, *, detail: str | None = None, runtime: float) -> None:
218218
"""Indicates that the program could not be executed successfully.
219219
220220
Args:

0 commit comments

Comments
 (0)