summaryrefslogtreecommitdiff
path: root/apt/auth.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-08-14 14:59:07 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-08-14 14:59:07 +0200
commit626172bce42c66671c4db8e76f005c678baf462a (patch)
tree0b3bff0d9ae4a225d9a7daa05ba36f900c91680f /apt/auth.py
parentc1ad8a0fbc0adfebdb847f28da92b3d5a1f90582 (diff)
parent81b72b5d1cf9ddb93f3f92af40b00dfff56174e7 (diff)
downloadpython-apt-626172bce42c66671c4db8e76f005c678baf462a.tar.gz
merged again from the debian-sid tree
Diffstat (limited to 'apt/auth.py')
-rw-r--r--apt/auth.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/apt/auth.py b/apt/auth.py
index 5d4b1cd6..e088ae85 100644
--- a/apt/auth.py
+++ b/apt/auth.py
@@ -28,6 +28,7 @@ import atexit
import os
import os.path
import subprocess
+import sys
import tempfile
import apt_pkg
@@ -69,7 +70,7 @@ def _call_apt_key_script(*args, **kwargs):
proc = subprocess.Popen(cmd, env=env, universal_newlines=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ stderr=subprocess.PIPE)
content = kwargs.get("stdin", None)
if isinstance(content, unicode):
@@ -77,12 +78,15 @@ def _call_apt_key_script(*args, **kwargs):
output, stderr = proc.communicate(content)
- assert stderr == None
-
if proc.returncode:
raise SystemError("The apt-key script failed with return code %s:\n"
- "%s\n%s" % (proc.returncode, " ".join(cmd),
- output))
+ "%s\n"
+ "stdout: %s\n"
+ "stderr: %s" % (proc.returncode, " ".join(cmd),
+ output,stderr))
+ elif stderr:
+ sys.stderr.write(stderr) # Forward stderr
+
return output.strip()
finally:
if conf is not None: