summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-08-14 18:30:35 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-08-14 18:30:35 (GMT)
commit82a3f8afcb0716cf524b4f731e25b4d6dca554a4 (patch)
treeddaf83316fd3b0489741c3e3c569e185c33071ed /Lib
parentac521078d7e7a3bd90678d252e8ff91970ec9f5c (diff)
downloadcpython-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.py4
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')