From: Florent Xicluna Date: Sat, 14 Aug 2010 18:30:35 +0000 (+0000) Subject: Silence the BytesWarning, due to patch r83294 for #9301 X-Git-Tag: v3.2a2~316 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=82a3f8afcb0716cf524b4f731e25b4d6dca554a4;p=thirdparty%2FPython%2Fcpython.git Silence the BytesWarning, due to patch r83294 for #9301 --- diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 44f4a4b13e7d..48b187ac6d97 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -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')