mirror of https://github.com/python/cpython
Silence the BytesWarning, due to patch r83294 for #9301
This commit is contained in:
parent
ac521078d7
commit
82a3f8afcb
|
@ -314,7 +314,9 @@ def unquote_to_bytes(string):
|
|||
"""unquote_to_bytes('abc%20def') -> b'abc def'."""
|
||||
# Note: strings are encoded as UTF-8. This is only an issue if it contains
|
||||
# unescaped non-ASCII characters, which URIs should not.
|
||||
if string in (b'', ''):
|
||||
if not string:
|
||||
# Is it a string-like object?
|
||||
string.split
|
||||
return b''
|
||||
if isinstance(string, str):
|
||||
string = string.encode('utf-8')
|
||||
|
|
Loading…
Reference in New Issue