Skip to content

bpo-43979: Remove unnecessary operation from urllib.parse.parse_qsl #25756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Lib/urllib/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,8 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
if max_num_fields < num_fields:
raise ValueError('Max number of fields exceeded')

pairs = [s1 for s1 in qs.split(separator)]
r = []
for name_value in pairs:
for name_value in qs.split(separator):
if not name_value and not strict_parsing:
continue
nv = name_value.split('=', 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removed an unnecessary list comprehension before looping from
:func:`urllib.parse.parse_qsl`. Patch by Christoph Zwerschke and Dong-hee Na.