mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add hacks for switching protocol and path but leaving host unchanged
This commit is contained in:
parent
eecf035aa2
commit
a1124700f8
2 changed files with 14 additions and 2 deletions
|
@ -350,13 +350,13 @@ class addinfo(addbase):
|
|||
|
||||
def basejoin(base, url):
|
||||
type, path = splittype(url)
|
||||
if type: return url
|
||||
host, path = splithost(path)
|
||||
if type and host: return url
|
||||
basetype, basepath = splittype(base)
|
||||
basehost, basepath = splithost(basepath)
|
||||
basepath, basetag = splittag(basepath)
|
||||
basepath, basequery = splitquery(basepath)
|
||||
type = basetype or 'file'
|
||||
if not type: type = basetype or 'file'
|
||||
if path[:1] != '/':
|
||||
i = string.rfind(basepath, '/')
|
||||
if i < 0: basepath = '/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue