Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
89318d89
Commit
89318d89
authored
Aug 03, 2008
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence some SyntaxWarnings for tuple unpacking in a parameter list for
urlparse when run under -3.
parent
92a62401
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Lib/urlparse.py
Lib/urlparse.py
+4
-2
No files found.
Lib/urlparse.py
View file @
89318d89
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment