summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pyfedpkg/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 3bb414d..a9d090f 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -109,7 +109,15 @@ def _name_from_spec(spec):
except OSError, e:
raise FedpkgError(e)
if error:
- raise FedpkgError(error)
+ if sys.stdout.isatty():
+ sys.stderr.write(error)
+ else:
+ # Yes, we could wind up sending error output to stdout in the
+ # case of no local tty, but I don't have a better way to do this.
+ log.info(error)
+ if proc.returncode:
+ raise FedpkgError('Could not parse the spec, exited %s' %
+ proc.returncode)
return output.split()[0]
def _run_command(cmd, shell=False, env=None, pipe=[], cwd=None):