summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-12-30 17:18:59 (GMT)
committerGuido van Rossum <guido@python.org>1994-12-30 17:18:59 (GMT)
commita1124700f80db19ff02d98f4de4303496c0d203a (patch)
treea7131d35a48466301ae6e19c524c1f26775f868a /Lib/urllib.py
parenteecf035aa209cedb4ede08b527120ba3946a0c96 (diff)
downloadcpython-a1124700f80db19ff02d98f4de4303496c0d203a.zip
cpython-a1124700f80db19ff02d98f4de4303496c0d203a.tar.gz
cpython-a1124700f80db19ff02d98f4de4303496c0d203a.tar.bz2
Add hacks for switching protocol and path but leaving host unchanged
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 651e37f..c49f032 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -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 = '/'