From 85c78e65668440e8a426d22356164894be8e1e58 Mon Sep 17 00:00:00 2001
From: Sergei Trofimov <sergei.trofimov@arm.com>
Date: Fri, 26 Jun 2015 12:14:02 +0100
Subject: [PATCH] sysfile_getter: fixed Exception when both device and host
 paths are empty.

---
 wlauto/instrumentation/misc/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wlauto/instrumentation/misc/__init__.py b/wlauto/instrumentation/misc/__init__.py
index 9e126268..ff580f66 100644
--- a/wlauto/instrumentation/misc/__init__.py
+++ b/wlauto/instrumentation/misc/__init__.py
@@ -166,7 +166,7 @@ class SysfsExtractor(Instrument):
         for paths in self.device_and_host_paths:
             after_dir = paths[self.AFTER_PATH]
             dev_dir = paths[self.DEVICE_PATH].strip('*')  # remove potential trailing '*'
-            if not os.listdir(after_dir) and self.device.listdir(dev_dir)[0]:
+            if not os.listdir(after_dir) and self.device.listdir(dev_dir):
                 self.logger.error('sysfs files were not pulled from the device.')
                 self.device_and_host_paths.remove(paths)  # Path is removed to skip diffing it
         for _, before_dir, after_dir, diff_dir in self.device_and_host_paths: