mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Enforce modern typing (#258)
* Allow UP * Upgrade typing * test smolagents * Change to contextlib --------- Co-authored-by: Marcus Valtonen Örnhag <marcus.valtonen.ornhag@ericsson.com>
This commit is contained in:
committed by
GitHub
parent
a07e9439b6
commit
f70b27bd41
@@ -7,9 +7,10 @@ import json
|
||||
import logging
|
||||
import tempfile
|
||||
import traceback
|
||||
from collections.abc import Callable
|
||||
from contextvars import ContextVar
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Literal, Protocol, TypedDict, cast
|
||||
from typing import Any, Literal, Protocol, TypedDict, cast
|
||||
|
||||
import av
|
||||
import librosa
|
||||
@@ -136,7 +137,7 @@ def split_output(
|
||||
raise ValueError(
|
||||
"The tuple must have exactly two elements: the data and an instance of AdditionalOutputs."
|
||||
)
|
||||
if not isinstance(data[-1], (AdditionalOutputs, CloseStream)):
|
||||
if not isinstance(data[-1], AdditionalOutputs | CloseStream):
|
||||
raise ValueError(
|
||||
"The last element of the tuple must be an instance of AdditionalOutputs."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user