浏览代码

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>
Ross Burton 7 年之前
父节点
当前提交
ef4c613ac1
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      bitbake/lib/bb/fetch2/wget.py

+ 2 - 1
bitbake/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")