Skip to content

Commit 9b3e548

Browse files
committed
Testing
1 parent cee2e09 commit 9b3e548

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

adb_shell/adb_device_async.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,12 @@ async def streaming_shell(self, command, transport_timeout_s=None, read_timeout_
904904
if not self.available:
905905
raise exceptions.AdbConnectionError("ADB command not sent because a connection to the device has not been established. (Did you call `AdbDeviceAsync.connect()`?)")
906906

907-
async for line in self._streaming_service(b'shell', command.encode('utf8'), transport_timeout_s, read_timeout_s, decode):
908-
yield line
907+
agen = self._streaming_service(b'shell', command.encode('utf8'), transport_timeout_s, read_timeout_s, decode)
908+
try:
909+
async for line in agen:
910+
yield line
911+
finally:
912+
await agen.aclose()
909913

910914
# ======================================================================= #
911915
# #

tests/async_wrapper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import warnings
3+
import sys
34

45

56

@@ -11,6 +12,9 @@ def _await(coro):
1112
ret = loop.run_until_complete(coro)
1213
loop.close()
1314

15+
for warn in warns:
16+
print(warn.message, file=sys.stderr)
17+
1418
if warns:
1519
raise RuntimeError
1620

0 commit comments

Comments
 (0)