Commit 82a3f8af authored by Florent Xicluna's avatar Florent Xicluna

Silence the BytesWarning, due to patch r83294 for #9301

parent ac521078
...@@ -314,7 +314,9 @@ def unquote_to_bytes(string): ...@@ -314,7 +314,9 @@ def unquote_to_bytes(string):
"""unquote_to_bytes('abc%20def') -> b'abc def'.""" """unquote_to_bytes('abc%20def') -> b'abc def'."""
# Note: strings are encoded as UTF-8. This is only an issue if it contains # Note: strings are encoded as UTF-8. This is only an issue if it contains
# unescaped non-ASCII characters, which URIs should not. # 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'' return b''
if isinstance(string, str): if isinstance(string, str):
string = string.encode('utf-8') string = string.encode('utf-8')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment