Browse Source

bpo-43979: Remove unnecessary operation from urllib.parse.parse_qsl (GH-25756)

Automerge-Triggered-By: GH:gpshead
pull/25761/head
Dong-hee Na 5 years ago
committed by GitHub
parent
commit
6143fcdf8b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      Lib/urllib/parse.py
  2. 2
      Misc/NEWS.d/next/Library/2021-05-01-01-36-51.bpo-43979.43oJ9L.rst

3
Lib/urllib/parse.py

@ -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)

2
Misc/NEWS.d/next/Library/2021-05-01-01-36-51.bpo-43979.43oJ9L.rst

@ -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.
Loading…
Cancel
Save