Skip to content

Commit 6143fcd

Browse files
authored
bpo-43979: Remove unnecessary operation from urllib.parse.parse_qsl (GH-25756)
Automerge-Triggered-By: GH:gpshead
1 parent 6689e45 commit 6143fcd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/urllib/parse.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,8 @@ def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
752752
if max_num_fields < num_fields:
753753
raise ValueError('Max number of fields exceeded')
754754

755-
pairs = [s1 for s1 in qs.split(separator)]
756755
r = []
757-
for name_value in pairs:
756+
for name_value in qs.split(separator):
758757
if not name_value and not strict_parsing:
759758
continue
760759
nv = name_value.split('=', 1)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Removed an unnecessary list comprehension before looping from
2+
:func:`urllib.parse.parse_qsl`. Patch by Christoph Zwerschke and Dong-hee Na.

0 commit comments

Comments
 (0)