diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-08-03 00:51:02 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-08-03 00:51:02 (GMT) |
commit | 89318d89d60298fda7d8672878d728e579eb9b20 (patch) | |
tree | 918a84e2c613e3a74d4d284b5e3c867add12c33e /Lib/urlparse.py | |
parent | 92a624019867885028fe0b326457b461e672eb3b (diff) | |
download | cpython-89318d89d60298fda7d8672878d728e579eb9b20.zip cpython-89318d89d60298fda7d8672878d728e579eb9b20.tar.gz cpython-89318d89d60298fda7d8672878d728e579eb9b20.tar.bz2 |
Silence some SyntaxWarnings for tuple unpacking in a parameter list for
urlparse when run under -3.
Diffstat (limited to 'Lib/urlparse.py')
-rw-r--r-- | Lib/urlparse.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/urlparse.py b/Lib/urlparse.py index 631a5a1..c384db7 100644 --- a/Lib/urlparse.py +++ b/Lib/urlparse.py @@ -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 |