Wrap partial in enum.member for Python 3.11+#238
Open
mweinelt wants to merge 3 commits intoJeffLIrion:masterfrom
Open
Wrap partial in enum.member for Python 3.11+#238mweinelt wants to merge 3 commits intoJeffLIrion:masterfrom
mweinelt wants to merge 3 commits intoJeffLIrion:masterfrom
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
Author
|
The remaining error seems to be
|
9b3e548 to
f3b4f10
Compare
13 tasks
|
That warning can be worked around by adding |
f3b4f10 to
9bdfa67
Compare
Author
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the following warning and the resulting test errors on Python 3.13.