Skip to content

Commit 3354a89

Browse files
codeskyblue孙圣翔²⁰₂₁
andauthored
fix back exist_ok (#1059)
Co-authored-by: 孙圣翔²⁰₂₁ <[email protected]>
1 parent 9336c29 commit 3354a89

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

uiautomator2/__init__.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,14 @@ def push(self, src, dst: str, mode=0o644):
210210
"""
211211
self._dev.sync.push(src, dst, mode=mode)
212212

213-
def pull(self, src: str, dst: str, exist_ok: bool = False):
213+
def pull(self, src: str, dst: str):
214214
"""
215215
Pull file from device to local
216216
"""
217-
self._dev.sync.pull(src, dst, exist_ok)
218-
219-
# FIXME: check if windows still need f.close
220-
# with open(dst, 'wb') as f:
221-
# shutil.copyfileobj(r.raw, f)
222-
# if _mswindows: # FIXME: check hotfix windows file size zero bug
223-
# f.close()
224-
217+
try:
218+
self._dev.sync.pull(src, dst, exist_ok=True)
219+
except TypeError:
220+
self._dev.sync.pull(src, dst)
225221

226222
class _Device(_BaseClient):
227223
__orientation = ( # device orientation

0 commit comments

Comments
 (0)