@@ -735,11 +735,9 @@ def _streaming_service(self, service, command, transport_timeout_s=None, read_ti
735
735
"""
736
736
stream = self ._streaming_command (service , command , transport_timeout_s , read_timeout_s , None )
737
737
if decode :
738
- for line in (stream_line .decode ('utf8' , _DECODE_ERRORS ) for stream_line in stream ):
739
- yield line
738
+ yield from (stream_line .decode ('utf8' , _DECODE_ERRORS ) for stream_line in stream )
740
739
else :
741
- for line in stream :
742
- yield line
740
+ yield from stream
743
741
744
742
def exec_out (self , command , transport_timeout_s = None , read_timeout_s = constants .DEFAULT_READ_TIMEOUT_S , timeout_s = None , decode = True ):
745
743
"""Send an ADB ``exec-out`` command to the device.
@@ -865,8 +863,7 @@ def streaming_shell(self, command, transport_timeout_s=None, read_timeout_s=cons
865
863
if not self .available :
866
864
raise exceptions .AdbConnectionError ("ADB command not sent because a connection to the device has not been established. (Did you call `AdbDevice.connect()`?)" )
867
865
868
- for line in self ._streaming_service (b'shell' , command .encode ('utf8' ), transport_timeout_s , read_timeout_s , decode ):
869
- yield line
866
+ yield from self ._streaming_service (b'shell' , command .encode ('utf8' ), transport_timeout_s , read_timeout_s , decode )
870
867
871
868
# ======================================================================= #
872
869
# #
@@ -1287,8 +1284,7 @@ def _streaming_command(self, service, command, transport_timeout_s, read_timeout
1287
1284
"""
1288
1285
adb_info = self ._open (b'%s:%s' % (service , command ), transport_timeout_s , read_timeout_s , timeout_s )
1289
1286
1290
- for data in self ._read_until_close (adb_info ):
1291
- yield data
1287
+ yield from self ._read_until_close (adb_info )
1292
1288
1293
1289
# ======================================================================= #
1294
1290
# #
0 commit comments