From 6f1163813a3f58e846da0f5fd23305a27f6c53e3 Mon Sep 17 00:00:00 2001 From: Gobot1234 Date: Wed, 20 Dec 2023 14:53:39 +0000 Subject: [PATCH] More 3.12 fixes for the same issue --- steam/abc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/steam/abc.py b/steam/abc.py index 338314a0..94d5ae13 100644 --- a/steam/abc.py +++ b/steam/abc.py @@ -102,7 +102,7 @@ def _COMMENTABLE_TYPE(cls: type[Self]) -> _CommentThreadType: try: return _CommentThreadType[cls.__name__] except KeyError: - raise AttributeError(f"{cls.__name__} is not a valid commentable") + raise AttributeError(f"{cls.__name__} is not a valid commentable type") def __init_subclass__(cls) -> None: super().__init_subclass__() @@ -268,7 +268,10 @@ class Awardable(Protocol[IDT]): # type: ignore # ReadOnly (PEP 705) should sav @classproperty def _AWARDABLE_TYPE(cls: type[Self]) -> _AwardableType: - return _AwardableType[cls.__name__] + try: + return _AwardableType[cls.__name__] + except KeyError: + raise AttributeError(f"{cls.__name__} is not a valid awardable type") def __init_subclass__(cls) -> None: super().__init_subclass__()