Skip to content
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

fix back exist_ok #1059

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions uiautomator2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,14 @@ def push(self, src, dst: str, mode=0o644):
"""
self._dev.sync.push(src, dst, mode=mode)

def pull(self, src: str, dst: str, exist_ok: bool = False):
def pull(self, src: str, dst: str):
"""
Pull file from device to local
"""
self._dev.sync.pull(src, dst, exist_ok)

# FIXME: check if windows still need f.close
# with open(dst, 'wb') as f:
# shutil.copyfileobj(r.raw, f)
# if _mswindows: # FIXME: check hotfix windows file size zero bug
# f.close()

try:
self._dev.sync.pull(src, dst, exist_ok=True)
except TypeError:
self._dev.sync.pull(src, dst)

class _Device(_BaseClient):
__orientation = ( # device orientation
Expand Down
Loading