Fix substitution err for schemeless manifest urls

Previously, we used a regex that would only remove a phony string from
a url if it existed, but we recently replaced that with a slice.  This
change goes back to the previous behavior.

Change-Id: I8baf527be01c4b49d45b903b31a1cd6315563d5b
This commit is contained in:
Conley Owens 2015-04-29 10:45:37 -07:00
parent 403b64edf4
commit 4ccad7554b

View File

@ -90,7 +90,8 @@ class _XmlRemote(object):
# and then replacing it with the original when we are done. # and then replacing it with the original when we are done.
if manifestUrl.find(':') != manifestUrl.find('/') - 1: if manifestUrl.find(':') != manifestUrl.find('/') - 1:
url = urllib.parse.urljoin('gopher://' + manifestUrl, url)[9:] url = urllib.parse.urljoin('gopher://' + manifestUrl, url)
url = re.sub(r'^gopher://', '', url)
else: else:
url = urllib.parse.urljoin(manifestUrl, url) url = urllib.parse.urljoin(manifestUrl, url)
return url return url