summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-16 13:01:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-19 23:54:41 +0000
commit202b7d05210cae0a781e1db11f0805519d6dc6ed (patch)
tree777c2418635f569aa368ecb376b02af4aeceb7bf /bitbake/lib/bb
parent8ded31e0526d30e3f86764288d2ae7002144bc02 (diff)
downloadpoky-202b7d05210cae0a781e1db11f0805519d6dc6ed.tar.gz
bitbake: fetch2/wget: Cleanup module imports
(Bitbake rev: ef062a3251af474fdeb480149856be3887b8c1c9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/fetch2/wget.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 3addb219d5..8ec5731b0c 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -33,11 +33,14 @@ import logging
33import errno 33import errno
34import bb 34import bb
35import bb.progress 35import bb.progress
36import socket
37import http.client
36import urllib.request, urllib.parse, urllib.error 38import urllib.request, urllib.parse, urllib.error
37from bb.fetch2 import FetchMethod 39from bb.fetch2 import FetchMethod
38from bb.fetch2 import FetchError 40from bb.fetch2 import FetchError
39from bb.fetch2 import logger 41from bb.fetch2 import logger
40from bb.fetch2 import runfetchcmd 42from bb.fetch2 import runfetchcmd
43from bb.fetch2 import FetchConnectionCache
41from bb.utils import export_proxies 44from bb.utils import export_proxies
42from bs4 import BeautifulSoup 45from bs4 import BeautifulSoup
43from bs4 import SoupStrainer 46from bs4 import SoupStrainer
@@ -132,10 +135,6 @@ class Wget(FetchMethod):
132 return True 135 return True
133 136
134 def checkstatus(self, fetch, ud, d, try_again=True): 137 def checkstatus(self, fetch, ud, d, try_again=True):
135 import urllib.request, urllib.error, urllib.parse, socket, http.client
136 from urllib.response import addinfourl
137 from bb.fetch2 import FetchConnectionCache
138
139 class HTTPConnectionCache(http.client.HTTPConnection): 138 class HTTPConnectionCache(http.client.HTTPConnection):
140 if fetch.connection_cache: 139 if fetch.connection_cache:
141 def connect(self): 140 def connect(self):
@@ -252,7 +251,7 @@ class Wget(FetchMethod):
252 pass 251 pass
253 closed = False 252 closed = False
254 253
255 resp = addinfourl(fp_dummy(), r.msg, req.get_full_url()) 254 resp = urllib.response.addinfourl(fp_dummy(), r.msg, req.get_full_url())
256 resp.code = r.status 255 resp.code = r.status
257 resp.msg = r.reason 256 resp.msg = r.reason
258 257
@@ -326,7 +325,7 @@ class Wget(FetchMethod):
326 add_basic_auth(ud.user + ':' + ud.pswd, r) 325 add_basic_auth(ud.user + ':' + ud.pswd, r)
327 326
328 try: 327 try:
329 import netrc, urllib.parse 328 import netrc
330 n = netrc.netrc() 329 n = netrc.netrc()
331 login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname) 330 login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname)
332 add_basic_auth("%s:%s" % (login, password), r) 331 add_basic_auth("%s:%s" % (login, password), r)