[Secure-testing-commits] r19904 - lib/python
Florian Weimer
fw at alioth.debian.org
Mon Aug 6 19:39:30 UTC 2012
Author: fw
Date: 2012-08-06 19:39:30 +0000 (Mon, 06 Aug 2012)
New Revision: 19904
Modified:
lib/python/debian_support.py
Log:
lib/python/debian_support.py: avoid GzipFile context manager
It is not available in Python 2.6.
Modified: lib/python/debian_support.py
===================================================================
--- lib/python/debian_support.py 2012-08-06 19:32:58 UTC (rev 19903)
+++ lib/python/debian_support.py 2012-08-06 19:39:30 UTC (rev 19904)
@@ -289,8 +289,14 @@
Returns the lines in the file."""
data = urllib2.urlopen(remote, timeout=TIMEOUT)
- with gzip.GzipFile(fileobj=StringIO(data.read())) as gfile:
- return gfile.readlines()
+ try:
+ gfile = gzip.GzipFile(fileobj=StringIO(data.read()))
+ try:
+ return gfile.readlines()
+ finally:
+ gfile.close()
+ finally:
+ data.close()
def downloadFile(remote, local):
"""Copies a gzipped remote file to the local system.
More information about the Secure-testing-commits
mailing list