bitbake: fetch/wget: use with to ensure the response is closed

(Bitbake rev: 8c487176d311557031cedba76185f14f0e7a14cd)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2017-11-03 12:38:45 +00:00
committed by Richard Purdie
parent e9967d9ed8
commit ef4c613ac1

View File

@@ -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")