Skip to content

Commit 82a3f8a

Browse files
committed
Silence the BytesWarning, due to patch r83294 for #9301
1 parent ac52107 commit 82a3f8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/urllib/parse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ def unquote_to_bytes(string):
314314
"""unquote_to_bytes('abc%20def') -> b'abc def'."""
315315
# Note: strings are encoded as UTF-8. This is only an issue if it contains
316316
# unescaped non-ASCII characters, which URIs should not.
317-
if string in (b'', ''):
317+
if not string:
318+
# Is it a string-like object?
319+
string.split
318320
return b''
319321
if isinstance(string, str):
320322
string = string.encode('utf-8')

0 commit comments

Comments
 (0)