summaryrefslogtreecommitdiff
path: root/pactest/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'pactest/util.py')
-rwxr-xr-xpactest/util.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pactest/util.py b/pactest/util.py
index 99d71e55..72777ca0 100755
--- a/pactest/util.py
+++ b/pactest/util.py
@@ -235,6 +235,14 @@ def diffmtime(mt1, mt2):
# Miscellaneous
#
+def which(filename):
+ path = os.environ["PATH"].split(':')
+ for p in path:
+ f = os.path.join(p, filename)
+ if os.access(f, os.F_OK):
+ return f
+ return None
+
def grep(filename, pattern):
lines = file(filename, 'r').readlines()
for line in lines: