Clean up locate

Signed-off-by: Martin J. Bligh <[email protected]>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1698 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/autotest_utils.py b/client/bin/autotest_utils.py
index 57cfc3a..89012e5 100755
--- a/client/bin/autotest_utils.py
+++ b/client/bin/autotest_utils.py
@@ -153,6 +153,7 @@
             return 1
     return 0
 
+
 def get_os_vendor():
     """Try to guess what's the os vendor
     """
@@ -478,9 +479,9 @@
 # much like find . -name 'pattern'
 def locate(pattern, root=os.getcwd()):
     for path, dirs, files in os.walk(root):
-        for f in [os.path.abspath(os.path.join(path, f))
-                for f in files if fnmatch.fnmatch(f, pattern)]:
-            yield f
+        for f in files:
+            if fnmatch.fnmatch(f, pattern):
+                yield os.path.abspath(os.path.join(path, f)
 
 
 def freespace(path):