diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/contrib/verify-homepage.py | 4 | ||||
| -rwxr-xr-x | scripts/send-error-report | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/scripts/contrib/verify-homepage.py b/scripts/contrib/verify-homepage.py index 265ff65d3c..18bb15b277 100755 --- a/scripts/contrib/verify-homepage.py +++ b/scripts/contrib/verify-homepage.py | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | import sys | 7 | import sys |
| 8 | import os | 8 | import os |
| 9 | import subprocess | 9 | import subprocess |
| 10 | import urllib2 | 10 | import urllib.request |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | # Allow importing scripts/lib modules | 13 | # Allow importing scripts/lib modules |
| @@ -47,7 +47,7 @@ def verifyHomepage(bbhandler): | |||
| 47 | homepage = data.getVar("HOMEPAGE", True) | 47 | homepage = data.getVar("HOMEPAGE", True) |
| 48 | if homepage: | 48 | if homepage: |
| 49 | try: | 49 | try: |
| 50 | urllib2.urlopen(homepage, timeout=5) | 50 | urllib.request.urlopen(homepage, timeout=5) |
| 51 | except Exception: | 51 | except Exception: |
| 52 | count = count + wgetHomepage(os.path.basename(realfn), homepage) | 52 | count = count + wgetHomepage(os.path.basename(realfn), homepage) |
| 53 | checked.append(realfn) | 53 | checked.append(realfn) |
diff --git a/scripts/send-error-report b/scripts/send-error-report index ed78bd6ebb..a9f6e42d17 100755 --- a/scripts/send-error-report +++ b/scripts/send-error-report | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | # Author: Andreea Proca <andreea.b.proca@intel.com> | 7 | # Author: Andreea Proca <andreea.b.proca@intel.com> |
| 8 | # Author: Michael Wood <michael.g.wood@intel.com> | 8 | # Author: Michael Wood <michael.g.wood@intel.com> |
| 9 | 9 | ||
| 10 | import urllib2 | 10 | import urllib.request, urllib.error |
| 11 | import sys | 11 | import sys |
| 12 | import json | 12 | import json |
| 13 | import os | 13 | import os |
| @@ -25,10 +25,10 @@ log = logging.getLogger("send-error-report") | |||
| 25 | logging.basicConfig(format='%(levelname)s: %(message)s') | 25 | logging.basicConfig(format='%(levelname)s: %(message)s') |
| 26 | 26 | ||
| 27 | def getPayloadLimit(url): | 27 | def getPayloadLimit(url): |
| 28 | req = urllib2.Request(url, None) | 28 | req = urllib.request.Request(url, None) |
| 29 | try: | 29 | try: |
| 30 | response = urllib2.urlopen(req) | 30 | response = urllib.request.urlopen(req) |
| 31 | except urllib2.URLError as e: | 31 | except urllib.error.URLError as e: |
| 32 | # Use this opportunity to bail out if we can't even contact the server | 32 | # Use this opportunity to bail out if we can't even contact the server |
| 33 | log.error("Could not contact server: " + url) | 33 | log.error("Could not contact server: " + url) |
| 34 | log.error(e.reason) | 34 | log.error(e.reason) |
| @@ -136,10 +136,10 @@ def send_data(data, args): | |||
| 136 | else: | 136 | else: |
| 137 | url = "http://"+args.server+"/ClientPost/" | 137 | url = "http://"+args.server+"/ClientPost/" |
| 138 | 138 | ||
| 139 | req = urllib2.Request(url, data=data, headers=headers) | 139 | req = urllib.request.Request(url, data=data, headers=headers) |
| 140 | try: | 140 | try: |
| 141 | response = urllib2.urlopen(req) | 141 | response = urllib.request.urlopen(req) |
| 142 | except urllib2.HTTPError, e: | 142 | except urllib.error.HTTPError as e: |
| 143 | logging.error(e.reason) | 143 | logging.error(e.reason) |
| 144 | sys.exit(1) | 144 | sys.exit(1) |
| 145 | 145 | ||
