Bug 843492 - Bootstrapping fails using Python 3x due to urllib2; r=gps

DONTBUID (NPOTB)
This commit is contained in:
Timur Timirkhanov
2013-04-03 05:38:00 -07:00
parent d988fd959e
commit 66f7ac8521
2 changed files with 11 additions and 5 deletions

View File

@@ -18,7 +18,10 @@ import os
import shutil
import sys
import tempfile
import urllib2
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
from optparse import OptionParser
@@ -51,7 +54,7 @@ def fetch_files(repo_url, repo_type):
for path in REPOSITORY_PATHS:
url = repo_url + '/raw-file/default/python/mozboot/' + path
req = urllib2.urlopen(url=url, timeout=30)
req = urlopen(url=url, timeout=30)
files[path] = req.read()
else:
raise NotImplementedError('Not sure how to handle repo type.', repo_type)