From 32eb1cd06404fdcb0d4507ea77e1685a19d185c1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 12 Jun 2012 09:00:23 +0200 Subject: merge fix from lp:~ev/python-apt/dont-leak-fds, many thanks --- apt/progress/base.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apt') diff --git a/apt/progress/base.py b/apt/progress/base.py index 4943978c..88b1ad21 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -146,6 +146,10 @@ class InstallProgress(object): 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.""" -- cgit v1.2.3