[llvm-commits] [zorg] r101734 - /zorg/trunk/lnt/lnt/testing/util/commands.py
Daniel Dunbar
daniel at zuster.org
Sun Apr 18 12:18:28 PDT 2010
Author: ddunbar
Date: Sun Apr 18 14:18:27 2010
New Revision: 101734
URL: http://llvm.org/viewvc/llvm-project?rev=101734&view=rev
Log:
LNT: Print a nicer failure message when trying to call a program that doesn't exist.
Modified:
zorg/trunk/lnt/lnt/testing/util/commands.py
Modified: zorg/trunk/lnt/lnt/testing/util/commands.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/testing/util/commands.py?rev=101734&r1=101733&r2=101734&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/testing/util/commands.py (original)
+++ zorg/trunk/lnt/lnt/testing/util/commands.py Sun Apr 18 14:18:27 2010
@@ -2,6 +2,7 @@
Miscellaneous utilities for running "scripts".
"""
+import errno
import inspect
import os
import sys
@@ -37,7 +38,12 @@
stderr = subprocess.PIPE
if include_stderr:
stderr = subprocess.STDOUT
- p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=stderr)
+ try:
+ p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=stderr)
+ except OSError,e:
+ if e.errno == errno.ENOENT:
+ fatal('no such file or directory: %r' % args[0])
+ raise
out,_ = p.communicate()
return out
More information about the llvm-commits
mailing list