Skip to content

Commit

Permalink
Add Python 3.11 and 3.12 to CI (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion authored Apr 8, 2024
1 parent e97dbf7 commit a0b8f8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 4 additions & 8 deletions adb_shell/adb_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,9 @@ def _streaming_service(self, service, command, transport_timeout_s=None, read_ti
"""
stream = self._streaming_command(service, command, transport_timeout_s, read_timeout_s, None)
if decode:
for line in (stream_line.decode('utf8', _DECODE_ERRORS) for stream_line in stream):
yield line
yield from (stream_line.decode('utf8', _DECODE_ERRORS) for stream_line in stream)
else:
for line in stream:
yield line
yield from stream

def exec_out(self, command, transport_timeout_s=None, read_timeout_s=constants.DEFAULT_READ_TIMEOUT_S, timeout_s=None, decode=True):
"""Send an ADB ``exec-out`` command to the device.
Expand Down Expand Up @@ -865,8 +863,7 @@ def streaming_shell(self, command, transport_timeout_s=None, read_timeout_s=cons
if not self.available:
raise exceptions.AdbConnectionError("ADB command not sent because a connection to the device has not been established. (Did you call `AdbDevice.connect()`?)")

for line in self._streaming_service(b'shell', command.encode('utf8'), transport_timeout_s, read_timeout_s, decode):
yield line
yield from self._streaming_service(b'shell', command.encode('utf8'), transport_timeout_s, read_timeout_s, decode)

# ======================================================================= #
# #
Expand Down Expand Up @@ -1287,8 +1284,7 @@ def _streaming_command(self, service, command, transport_timeout_s, read_timeout
"""
adb_info = self._open(b'%s:%s' % (service, command), transport_timeout_s, read_timeout_s, timeout_s)

for data in self._read_until_close(adb_info):
yield data
yield from self._read_until_close(adb_info)

# ======================================================================= #
# #
Expand Down
3 changes: 1 addition & 2 deletions adb_shell/transport/usb_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,5 +643,4 @@ def find_all_adb_devices(cls, default_transport_timeout_s=None):
A generator which yields each ADB device attached via USB.
"""
for dev in cls._find_devices(interface_matcher(CLASS, SUBCLASS, PROTOCOL), default_transport_timeout_s=default_transport_timeout_s):
yield dev
yield from cls._find_devices(interface_matcher(CLASS, SUBCLASS, PROTOCOL), default_transport_timeout_s=default_transport_timeout_s)

0 comments on commit a0b8f8a

Please sign in to comment.