Commit 89318d89 authored by Brett Cannon's avatar Brett Cannon

Silence some SyntaxWarnings for tuple unpacking in a parameter list for

urlparse when run under -3.
parent 92a62401
......@@ -173,16 +173,18 @@ def urlsplit(url, scheme='', allow_fragments=True):
_parse_cache[key] = v
return v
def urlunparse((scheme, netloc, url, params, query, fragment)):
def urlunparse(data):
"""Put a parsed URL back together again. This may result in a
slightly different, but equivalent URL, if the URL that was parsed
originally had redundant delimiters, e.g. a ? with an empty query
(the draft states that these are equivalent)."""
scheme, netloc, url, params, query, fragment = data
if params:
url = "%s;%s" % (url, params)
return urlunsplit((scheme, netloc, url, query, fragment))
def urlunsplit((scheme, netloc, url, query, fragment)):
def urlunsplit(data):
scheme, netloc, url, query, fragment = data
if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'):
if url and url[:1] != '/': url = '/' + url
url = '//' + (netloc or '') + url
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment