Skip to content

Commit 614b288

Browse files
committed
Use TextIOWrapper to typecheck scenario input
TextIOWrapper should be of type TextIO but TextIO does not seem to work for typecheck. Just use the class as type argument of isinstance.
1 parent 047d37b commit 614b288

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/guidellm/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
from io import TextIOWrapper
23
from typing import Literal, Optional, Sequence, TextIO, Union, get_args
34

45
import click
@@ -184,7 +185,7 @@ def generate_benchmark_report_cli(
184185

185186
if isinstance(scenario, str):
186187
defaults = SCENARIOS[scenario]
187-
elif isinstance(scenario, TextIO):
188+
elif isinstance(scenario, TextIOWrapper):
188189
defaults = Scenario.from_json(scenario.read())
189190
elif scenario is None:
190191
defaults = Scenario()

0 commit comments

Comments
 (0)