path: root/src
diff options
authorJesse Keating <>2011-02-11 02:15:18 -0700
committerJesse Keating <>2011-02-11 02:15:18 -0700
commit9ff587cf36f042f12e8c350f8897b13690a984fd (patch)
tree066e1f1a11d3079225d6be278fe2c1071b72d193 /src
parentff91098ad907f4182ce95ef95183ea8891d78882 (diff)
Don't error out just from stderr from rpm
Rpm can be bitchy, but also return 0, so handle that. Also try to do something meaningful / useful with the error output.
Diffstat (limited to 'src')
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pyfedpkg/ b/src/pyfedpkg/
index 3bb414d..a9d090f 100644
--- a/src/pyfedpkg/
+++ b/src/pyfedpkg/
@@ -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.
+ 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):