summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author花浅葱 <ambiguous404@gmail.com>2017-12-09 20:20:16 +0800
committerMarcel Hellkamp <marc@gsites.de>2017-12-09 13:20:16 +0100
commit06cc47b1f5403767ccc792b4ac739c4948982de4 (patch)
treedbe148d357bf125bfa3472681df3dd9fe553d6b1
parent459b8e93dba5fded88415de7340021d8a7db138b (diff)
downloadbottle-06cc47b1f5403767ccc792b4ac739c4948982de4.tar.gz
fix pass None to tob (#1018)
-rwxr-xr-xbottle.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bottle.py b/bottle.py
index c556baf..e75944c 100755
--- a/bottle.py
+++ b/bottle.py
@@ -161,7 +161,7 @@ else: # 2.x
def tob(s, enc='utf8'):
if isinstance(s, unicode):
return s.encode(enc)
- return bytes("" if s is None else s)
+ return b'' if s is None else bytes(s)
def touni(s, enc='utf8', err='strict'):