We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1342a95 commit 1c56c86Copy full SHA for 1c56c86
mjpeg_streamer/stream.py
@@ -14,6 +14,10 @@ def __init__(
14
name: str,
15
fps: int = 30,
16
) -> None:
17
+ if type(self) is StreamBase:
18
+ raise TypeError(
19
+ "StreamBase is an abstract class and cannot be instantiated."
20
+ )
21
self.name = name.casefold().replace(" ", "_")
22
self.fps = fps
23
self._frame: np.ndarray = np.zeros((320, 240, 1), dtype=np.uint8)
@@ -23,9 +27,6 @@ def __init__(
27
self._active_viewers: Set[str] = set()
24
28
self._bandwidth_background_task: Optional[asyncio.Task] = None
25
29
26
- def __new__(self, *args, **kwargs):
- raise TypeError("Cannot instantiate an abstract class")
-
30
async def _ensure_background_tasks(self) -> None:
31
if (
32
self._bandwidth_background_task is None
0 commit comments