Skip to content

Commit 61bab3b

Browse files
lazytyperoblabla
andauthored
Update src/betterproto/plugin/models.py
Co-authored-by: Robin Lambertz <github@roblab.la>
1 parent 3f62ec0 commit 61bab3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/betterproto/plugin/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,8 @@ def __post_init__(self) -> None:
655655
self.output_file.typing_imports.add("Union")
656656

657657
# Required by both client and server
658-
self.output_file.typing_imports.add("AsyncIterator")
658+
if self.client_streaming or self.server_streaming:
659+
self.output_file.typing_imports.add("AsyncIterator")
659660

660661
super().__post_init__() # check for unset fields
661662

0 commit comments

Comments
 (0)