diff options
| author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-08-14 18:30:35 +0000 |
|---|---|---|
| committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-08-14 18:30:35 +0000 |
| commit | 82a3f8afcb0716cf524b4f731e25b4d6dca554a4 (patch) | |
| tree | ddaf83316fd3b0489741c3e3c569e185c33071ed | |
| parent | ac521078d7e7a3bd90678d252e8ff91970ec9f5c (diff) | |
| download | cpython-git-82a3f8afcb0716cf524b4f731e25b4d6dca554a4.tar.gz | |
Silence the BytesWarning, due to patch r83294 for #9301
| -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 44f4a4b13e..48b187ac6d 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') |
