diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-08-14 18:30:35 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-08-14 18:30:35 (GMT) |
commit | 82a3f8afcb0716cf524b4f731e25b4d6dca554a4 (patch) | |
tree | ddaf83316fd3b0489741c3e3c569e185c33071ed /Lib | |
parent | ac521078d7e7a3bd90678d252e8ff91970ec9f5c (diff) | |
download | cpython-82a3f8afcb0716cf524b4f731e25b4d6dca554a4.zip cpython-82a3f8afcb0716cf524b4f731e25b4d6dca554a4.tar.gz cpython-82a3f8afcb0716cf524b4f731e25b4d6dca554a4.tar.bz2 |
Silence the BytesWarning, due to patch r83294 for #9301
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/urllib/parse.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 44f4a4b..48b187a 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') |