Fix switched b() functions.

* FIXES mistake from commit 16107bc8a8
master^2
Isis Lovecruft 2015-03-19 00:07:19 +00:00
parent 76d70c68aa
commit a06c93d6e7
No known key found for this signature in database
GPG Key ID: 18C16EC5F9F1D673
1 changed files with 6 additions and 2 deletions

View File

@ -169,7 +169,11 @@ def find_encodings(enc=None, system=False):
if _py3k:
def b(x):
"""See http://python3porting.com/problems.html#nicer-solutions"""
return x
coder = find_encodings()
if isinstance(x, bytes):
return coder.encode(x.decode(coder.name))[0]
else:
return coder.encode(x)[0]
def s(x):
if isinstance(x, str):
@ -181,7 +185,7 @@ if _py3k:
else:
def b(x):
"""See http://python3porting.com/problems.html#nicer-solutions"""
return find_encodings().encode(x)[0]
return x
def s(x):
if isinstance(x, basestring):