aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/urlparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urlparse.py')
-rw-r--r--Lib/urlparse.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index cd6ad26dae7..ee99645d59b 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -87,7 +87,9 @@ def urlsplit(url, scheme='', allow_fragments=1):
if url[:2] == '//':
i = url.find('/', 2)
if i < 0:
- i = len(url)
+ i = url.find('#')
+ if i < 0:
+ i = len(url)
netloc = url[2:i]
url = url[i:]
if allow_fragments and '#' in url: