summaryrefslogtreecommitdiff
path: root/apt/progress
diff options
context:
space:
mode:
authorEvan Dandrea <evan.dandrea@canonical.com>2012-06-12 16:06:16 +0100
committerEvan Dandrea <evan.dandrea@canonical.com>2012-06-12 16:06:16 +0100
commit5cdd74bc9e017f8802f96d915131c8cf525d4146 (patch)
treed50f69f317038902ca97a3e0d79883dcefeadc01 /apt/progress
parentbcef41df6bdefdd95e0b7cab0428b4655accf9fa (diff)
downloadpython-apt-5cdd74bc9e017f8802f96d915131c8cf525d4146.tar.gz
Drop __del__ statement, which is unsafe: http://www.algorithm.co.il/blogs/programming/python-gotchas-1-__del__-is-not-the-opposite-of-__init__/
Diffstat (limited to 'apt/progress')
-rw-r--r--apt/progress/base.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/apt/progress/base.py b/apt/progress/base.py
index 88b1ad21..ab57dd82 100644
--- a/apt/progress/base.py
+++ b/apt/progress/base.py
@@ -142,14 +142,11 @@ 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)
- def __del__(self):
- self.write_stream.close()
- self.status_stream.close()
-
def start_update(self):
"""(Abstract) Start update."""