diff --git a/adb/adb_commands.py b/adb/adb_commands.py index f3667c8..eed370f 100644 --- a/adb/adb_commands.py +++ b/adb/adb_commands.py @@ -31,6 +31,11 @@ from adb import common from adb import filesync_protocol +try: + file # Python 2 +except NameError: # Python 3 + file = io.IOBase + # From adb.h CLASS = 0xFF SUBCLASS = 0x42 diff --git a/adb/filesync_protocol.py b/adb/filesync_protocol.py index d0547f4..599c499 100644 --- a/adb/filesync_protocol.py +++ b/adb/filesync_protocol.py @@ -28,6 +28,12 @@ from adb import adb_protocol from adb import usb_exceptions +try: + file # Python 2 +except NameError: # Python 3 + import io + file = io.IOBase + # Default mode for pushed files. DEFAULT_PUSH_MODE = stat.S_IFREG | stat.S_IRWXU | stat.S_IRWXG # Maximum size of a filesync DATA packet.