aboutsummaryrefslogtreecommitdiff
path: root/devlib/target.py
diff options
context:
space:
mode:
authorSergei Trofimov <sergei.trofimov@arm.com>2015-11-18 18:07:47 +0000
committerSergei Trofimov <sergei.trofimov@arm.com>2015-11-18 18:11:59 +0000
commitb53245344b7c0b287085e874c2aa0e4814b96783 (patch)
tree270d5fbbe4de9df32103da2e30be0d5d4263606c /devlib/target.py
parent961f9576e53fc296f333313f3c9e240297afa368 (diff)
downloaddevlib-b53245344b7c0b287085e874c2aa0e4814b96783.tar.gz
target: fixed get_installed() on new targets
get_installed() looks in self.executables_directory for the binary. This may not exist on a target (this is created when setup() is invoked). This commit updated get_installed() to check whether target_directory exists first, avoiding the error.
Diffstat (limited to 'devlib/target.py')
-rw-r--r--devlib/target.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/devlib/target.py b/devlib/target.py
index 19fbcbb..6b9f760 100644
--- a/devlib/target.py
+++ b/devlib/target.py
@@ -402,8 +402,9 @@ class Target(object):
return self.path.join(path, name)
except TargetError:
pass # directory does not exist or no executable premssions
- if name in self.list_directory(self.executables_directory):
- return self.path.join(self.executables_directory, name)
+ if self.file_exists(self.executables_directory):
+ if name in self.list_directory(self.executables_directory):
+ return self.path.join(self.executables_directory, name)
which = get_installed