[py23] Make tobytes() always return bytes even for bytearray
This commit is contained in:
parent
ec80f24315
commit
80069e9608
@ -74,7 +74,7 @@ def tobytes(s, encoding="ascii", errors="strict"):
|
||||
if isinstance(s, str):
|
||||
return s.encode(encoding, errors)
|
||||
else:
|
||||
return s
|
||||
return bytes(s)
|
||||
|
||||
|
||||
def tounicode(s, encoding="ascii", errors="strict"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user