mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
gh-95865: Speed up urllib.parse.quote_from_bytes() (GH-95872)
This commit is contained in:
parent
88671a9d69
commit
8ba22b90ca
2 changed files with 2 additions and 1 deletions
|
|
@ -906,7 +906,7 @@ def quote_from_bytes(bs, safe='/'):
|
|||
if not bs.rstrip(_ALWAYS_SAFE_BYTES + safe):
|
||||
return bs.decode()
|
||||
quoter = _byte_quoter_factory(safe)
|
||||
return ''.join([quoter(char) for char in bs])
|
||||
return ''.join(map(quoter, bs))
|
||||
|
||||
def urlencode(query, doseq=False, safe='', encoding=None, errors=None,
|
||||
quote_via=quote_plus):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue