Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Commit bd3253d

Browse files
committed
google-assistant-sdk/audio_helpers: fix generator termination
Per https://www.python.org/dev/peps/pep-0479/: """ the proper way is return, not raise StopIteration. """ Bug: 111928212 Change-Id: Iab065bdbe7800f36feeaeba8deb22ab8cbdac525
1 parent ee3b4ac commit bd3253d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google-assistant-sdk/googlesamples/assistant/grpc/audio_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def __iter__(self):
335335
"""Returns a generator reading data from the stream."""
336336
while True:
337337
if self._stop_recording.is_set():
338-
raise StopIteration
338+
return
339339
yield self.read(self._iter_size)
340340

341341
@property

0 commit comments

Comments
 (0)