File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 33import json
44import logging
55from abc import ABC , abstractmethod
6+ from collections .abc import Iterator
67from dataclasses import dataclass
78from functools import partial
89from http .server import BaseHTTPRequestHandler , HTTPServer
910from typing import TYPE_CHECKING , NamedTuple
11+
1012from typing_extensions import Protocol
1113
1214from ..cli .cli import Options
1315
1416if TYPE_CHECKING :
1517 from collections .abc import Callable
1618 from pathlib import Path
17- from typing import Any , Final , Iterator
19+ from typing import Any , Final
1820
1921
2022_LOGGER : Final = logging .getLogger (__name__ )
@@ -86,8 +88,7 @@ class JsonRpcBatchRequest(NamedTuple):
8688class JsonRpcResult (ABC ):
8789
8890 @abstractmethod
89- def encode (self ) -> Iterator [bytes ]:
90- ...
91+ def encode (self ) -> Iterator [bytes ]: ...
9192
9293
9394@dataclass (frozen = True )
@@ -138,8 +139,7 @@ def encode(self) -> Iterator[bytes]:
138139 yield b','
139140 else :
140141 first = False
141- for chunk in result .encode ():
142- yield chunk
142+ yield from result .encode ()
143143 yield b']'
144144
145145
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- from collections .abc import Iterator
43import json
54from http .client import HTTPConnection
65from threading import Thread
76from time import sleep
8- from typing import TYPE_CHECKING , Iterator
7+ from typing import TYPE_CHECKING
98
109from pyk .cterm import CTerm
1110from pyk .kast .inner import KApply , KSequence , KSort , KToken
1615from pyk .testing import KRunTest
1716
1817if TYPE_CHECKING :
18+ from collections .abc import Iterator
1919 from typing import Any
2020
2121
@@ -171,7 +171,7 @@ def exec_set_y(self, n: int) -> None:
171171
172172 def exec_add (self ) -> int :
173173 return self .x + self .y
174-
174+
175175 def exec_streaming (self ) -> Iterator [bytes ]:
176176 yield b'{'
177177 yield b'"foo": "bar"'
You can’t perform that action at this time.
0 commit comments