Skip to content

Commit

Permalink
#12 and #13 were reintroduced in 1342a95 + remove __new__ override
Browse files Browse the repository at this point in the history
  • Loading branch information
egeakman committed Apr 5, 2024
1 parent 1342a95 commit 1c56c86
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mjpeg_streamer/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def __init__(
name: str,
fps: int = 30,
) -> None:
if type(self) is StreamBase:
raise TypeError(
"StreamBase is an abstract class and cannot be instantiated."
)
self.name = name.casefold().replace(" ", "_")
self.fps = fps
self._frame: np.ndarray = np.zeros((320, 240, 1), dtype=np.uint8)
Expand All @@ -23,9 +27,6 @@ def __init__(
self._active_viewers: Set[str] = set()
self._bandwidth_background_task: Optional[asyncio.Task] = None

def __new__(self, *args, **kwargs):
raise TypeError("Cannot instantiate an abstract class")

async def _ensure_background_tasks(self) -> None:
if (
self._bandwidth_background_task is None
Expand Down

0 comments on commit 1c56c86

Please sign in to comment.