Skip to content

Commit c91c73f

Browse files
Make format
1 parent b474eee commit c91c73f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pyk/src/pyk/rpc/rpc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
import json
44
import logging
55
from abc import ABC, abstractmethod
6+
from collections.abc import Iterator
67
from dataclasses import dataclass
78
from functools import partial
89
from http.server import BaseHTTPRequestHandler, HTTPServer
910
from typing import TYPE_CHECKING, NamedTuple
11+
1012
from typing_extensions import Protocol
1113

1214
from ..cli.cli import Options
1315

1416
if 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):
8688
class 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

pyk/src/tests/integration/test_json_rpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from __future__ import annotations
22

3-
from collections.abc import Iterator
43
import json
54
from http.client import HTTPConnection
65
from threading import Thread
76
from time import sleep
8-
from typing import TYPE_CHECKING, Iterator
7+
from typing import TYPE_CHECKING
98

109
from pyk.cterm import CTerm
1110
from pyk.kast.inner import KApply, KSequence, KSort, KToken
@@ -16,6 +15,7 @@
1615
from pyk.testing import KRunTest
1716

1817
if 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"'

0 commit comments

Comments
 (0)