summaryrefslogtreecommitdiff
path: root/apt/progress/base.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-08-14 14:58:25 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-08-14 14:58:25 +0200
commitc1ad8a0fbc0adfebdb847f28da92b3d5a1f90582 (patch)
tree80225148a1c1d0d4283fb76e827c6ccc9ca206bf /apt/progress/base.py
parentc736d5c9290a2ffdb8802a4ac62e521cf1218b54 (diff)
parentdfd6bacface878eecf3fec4876bdae2f0491a646 (diff)
downloadpython-apt-c1ad8a0fbc0adfebdb847f28da92b3d5a1f90582.tar.gz
merged from the debian-sid tree
Diffstat (limited to 'apt/progress/base.py')
-rw-r--r--apt/progress/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt/progress/base.py b/apt/progress/base.py
index 97375431..ab57dd82 100644
--- a/apt/progress/base.py
+++ b/apt/progress/base.py
@@ -27,6 +27,7 @@ import fcntl
import os
import re
import select
+import sys
import apt_pkg
@@ -141,6 +142,7 @@ class InstallProgress(object):
def __init__(self):
(self.statusfd, self.writefd) = os.pipe()
+ # These will leak fds, but fixing this safely requires API changes.
self.write_stream = os.fdopen(self.writefd, "w")
self.status_stream = os.fdopen(self.statusfd, "r")
fcntl.fcntl(self.statusfd, fcntl.F_SETFL, os.O_NONBLOCK)
@@ -196,7 +198,8 @@ class InstallProgress(object):
os._exit(os.spawnlp(os.P_WAIT, "dpkg", "dpkg", "--status-fd",
str(self.write_stream.fileno()), "-i",
obj))
- except Exception:
+ except Exception as e:
+ sys.stderr.write("%s\n" % e)
os._exit(apt_pkg.PackageManager.RESULT_FAILED)
self.child_pid = pid