From: Brett Cannon Date: Sun, 3 Aug 2008 00:51:02 +0000 (+0000) Subject: Silence some SyntaxWarnings for tuple unpacking in a parameter list for X-Git-Tag: v2.6b3~167 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89318d89d60298fda7d8672878d728e579eb9b20;p=thirdparty%2FPython%2Fcpython.git Silence some SyntaxWarnings for tuple unpacking in a parameter list for urlparse when run under -3. --- diff --git a/Lib/urlparse.py b/Lib/urlparse.py index 631a5a1cb318..c384db782be0 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