summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
Diffstat (limited to 'apt')
-rw-r--r--apt/progress/base.py4
-rw-r--r--apt/utils.py2
2 files changed, 5 insertions, 1 deletions
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."""
diff --git a/apt/utils.py b/apt/utils.py
index 49e8bed5..08140258 100644
--- a/apt/utils.py
+++ b/apt/utils.py
@@ -48,7 +48,7 @@ def get_release_date_from_release_file(path):
if not path or not os.path.exists(path):
return None
tag = apt_pkg.TagFile(open(path))
- section = tag.next()
+ section = next(tag)
if not "Date" in section:
return None
date = section["Date"]