summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2014-09-26 15:39:24 +0300
committerMarius Gedminas <marius@gedmin.as>2014-09-26 15:39:24 +0300
commitbadbed7115dc6de2207b95f1fd1e7c3fddeced37 (patch)
tree162e253a57960b80a0cf429a44094385d29c2bf6
parentf8a4a6218d4431b1a227f907685e88c5a3ad35a7 (diff)
downloadtox-badbed7115dc6de2207b95f1fd1e7c3fddeced37.tar.gz
Report subprocess exit code when invocation fails
Fixes #192
-rw-r--r--tests/test_z_cmdline.py2
-rw-r--r--tox/_cmdline.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py
index 283c993..57aba64 100644
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -200,7 +200,7 @@ def test_run_custom_install_command_error(cmd, initproj):
})
result = cmd.run("tox")
result.stdout.fnmatch_lines([
- "ERROR: invocation failed, args: ['*/tox.ini*",
+ "ERROR: invocation failed (errno 13), args: ['*/tox.ini*",
])
assert result.ret
diff --git a/tox/_cmdline.py b/tox/_cmdline.py
index aed71ec..0df2f17 100644
--- a/tox/_cmdline.py
+++ b/tox/_cmdline.py
@@ -95,9 +95,9 @@ class Action(object):
try:
popen = self._popen(args, cwd, env=env,
stdout=f, stderr=STDOUT)
- except OSError:
- self.report.error("invocation failed, args: %s, cwd: %s" %
- (args, cwd))
+ except OSError as e:
+ self.report.error("invocation failed (errno %d), args: %s, cwd: %s" %
+ (e.errno, args, cwd))
raise
popen.outpath = outpath
popen.args = [str(x) for x in args]
@@ -118,8 +118,8 @@ class Action(object):
if ret:
invoked = " ".join(map(str, popen.args))
if outpath:
- self.report.error("invocation failed, logfile: %s" %
- outpath)
+ self.report.error("invocation failed (exit code %d), logfile: %s" %
+ (ret, outpath))
out = outpath.read()
self.report.error(out)
if hasattr(self, "commandlog"):