-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap partial in enum.member for Python 3.11+ #238
base: master
Are you sure you want to change the base?
Conversation
Fixes the following warning and the resulting test errors on Python 3.13. > functools.partial will be a method descriptor in future Python versions; > wrap it in enum.member() if you want to preserve the old behavior
The remaining error seems to be
|
9b3e548
to
f3b4f10
Compare
That warning can be worked around by adding |
f3b4f10
to
9bdfa67
Compare
I tried the following change, but it didn't help. diff --git a/adb_shell/adb_device_async.py b/adb_shell/adb_device_async.py
index 84ce523..c8cc170 100644
--- a/adb_shell/adb_device_async.py
+++ b/adb_shell/adb_device_async.py
@@ -904,8 +904,12 @@ class AdbDeviceAsync(object):
if not self.available:
raise exceptions.AdbConnectionError("ADB command not sent because a connection to the device has not been established. (Did you call `AdbDeviceAsync.connect()`?)")
- async for line in self._streaming_service(b'shell', command.encode('utf8'), transport_timeout_s, read_timeout_s, decode):
- yield line
+ agen = self._streaming_service(b'shell', command.encode('utf8'), transport_timeout_s, read_timeout_s, decode)
+ try:
+ async for line in agen:
+ yield line
+ finally:
+ await agen.aclose()
# ======================================================================= #
# # |
3.13 is the latest version and 3.7/3.8 have both reached EOL..
If they are caught and we raise RuntimeError those warnings will not be visible anymore, which makes noticing and fixing them so much harder.
9bdfa67
to
cb628ff
Compare
Fixes the following warning and the resulting test errors on Python 3.13.