Skip to content

Commit 608bd7f

Browse files
simplify error handling
1 parent f80b33f commit 608bd7f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/pygambit/catalog/catalog.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ class CatalogGame:
2626

2727
def __new__(cls, *args, **kwargs) -> Game:
2828
"""Create a game instance by calling the _game() method."""
29-
if hasattr(cls, "_game") and cls._game is not CatalogGame._game:
30-
if cls._cached_game is None:
31-
cls._cached_game = cls._game(*args, **kwargs)
32-
return cls._cached_game
33-
raise NotImplementedError("Subclasses must implement _game() method")
29+
if cls._cached_game is None:
30+
cls._cached_game = cls._game(*args, **kwargs)
31+
return cls._cached_game
3432

3533
@staticmethod
3634
def _game() -> Game:

0 commit comments

Comments
 (0)