Quellcode durchsuchen

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
Conley Owens vor 10 Jahren
Ursprung
Commit
793c7041b8
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      manifest_xml.py

+ 2 - 1
manifest_xml.py

@@ -90,7 +90,8 @@ class _XmlRemote(object):
     # and then replacing it with the original when we are done.
 
     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:
       url = urllib.parse.urljoin(manifestUrl, url)
     return url