aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2017-11-03 12:38:45 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-21 13:01:57 +0000
commit8c487176d311557031cedba76185f14f0e7a14cd (patch)
tree6df0bb451852e8be33a96732b3faed4c314d2b31 /lib
parent7b072ef91d16331eae11bd60f229ce1f0c175995 (diff)
downloadbitbake-8c487176d311557031cedba76185f14f0e7a14cd.zip
bitbake-8c487176d311557031cedba76185f14f0e7a14cd.tar.gz
bitbake-8c487176d311557031cedba76185f14f0e7a14cd.tar.bz2
fetch/wget: use with to ensure the response is closed
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/fetch2/wget.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index c83eba3..8f505b6 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -333,7 +333,8 @@ class Wget(FetchMethod):
except (TypeError, ImportError, IOError, netrc.NetrcParseError):
pass
- opener.open(r)
+ with opener.open(r) as response:
+ pass
except urllib.error.URLError as e:
if try_again:
logger.debug(2, "checkstatus: trying again")