Skip to content

Commit a0b8f8a

Browse files
authored
Add Python 3.11 and 3.12 to CI (#233)
1 parent e97dbf7 commit a0b8f8a

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

.github/workflows/python-package.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: ['3.7', '3.8', '3.9', '3.10']
21+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
2222

2323
steps:
2424
- uses: actions/checkout@v2

adb_shell/adb_device.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -735,11 +735,9 @@ def _streaming_service(self, service, command, transport_timeout_s=None, read_ti
735735
"""
736736
stream = self._streaming_command(service, command, transport_timeout_s, read_timeout_s, None)
737737
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)
740739
else:
741-
for line in stream:
742-
yield line
740+
yield from stream
743741

744742
def exec_out(self, command, transport_timeout_s=None, read_timeout_s=constants.DEFAULT_READ_TIMEOUT_S, timeout_s=None, decode=True):
745743
"""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
865863
if not self.available:
866864
raise exceptions.AdbConnectionError("ADB command not sent because a connection to the device has not been established. (Did you call `AdbDevice.connect()`?)")
867865

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)
870867

871868
# ======================================================================= #
872869
# #
@@ -1287,8 +1284,7 @@ def _streaming_command(self, service, command, transport_timeout_s, read_timeout
12871284
"""
12881285
adb_info = self._open(b'%s:%s' % (service, command), transport_timeout_s, read_timeout_s, timeout_s)
12891286

1290-
for data in self._read_until_close(adb_info):
1291-
yield data
1287+
yield from self._read_until_close(adb_info)
12921288

12931289
# ======================================================================= #
12941290
# #

adb_shell/transport/usb_transport.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -643,5 +643,4 @@ def find_all_adb_devices(cls, default_transport_timeout_s=None):
643643
A generator which yields each ADB device attached via USB.
644644
645645
"""
646-
for dev in cls._find_devices(interface_matcher(CLASS, SUBCLASS, PROTOCOL), default_transport_timeout_s=default_transport_timeout_s):
647-
yield dev
646+
yield from cls._find_devices(interface_matcher(CLASS, SUBCLASS, PROTOCOL), default_transport_timeout_s=default_transport_timeout_s)

0 commit comments

Comments
 (0)