Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
Bug 1212758 - Autophone - ADBDevice.mkdir - reproduce behavior of mkd…
Browse files Browse the repository at this point in the history
…ir -p, r=jmaher.
  • Loading branch information
bclary committed Oct 9, 2015
1 parent 25c449e commit 1e9827c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion adb.py
Expand Up @@ -1485,7 +1485,13 @@ def mkdir(self, path, parents=False, timeout=None, root=False):
# exitcode to raise an ADBError.
self.shell_output('mkdir %s' % name,
timeout=timeout, root=root)
self.shell_output('mkdir %s' % path, timeout=timeout, root=root)

# If parents is True and the directory does exist, we don't
# need to do anything. Otherwise we call mkdir. If the
# directory already exists or if it is a file instead of a
# directory, mkdir will fail and we will raise an ADBError.
if not parents or not self.is_dir(path, root=root):
self.shell_output('mkdir %s' % path, timeout=timeout, root=root)
if not self.is_dir(path, timeout=timeout, root=root):
raise ADBError('mkdir %s Failed' % path)

Expand Down

0 comments on commit 1e9827c

Please sign in to comment.