summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-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)