Commit 752e4d2b authored by Jim Fulton's avatar Jim Fulton

No need for binary type

parent 03984293
......@@ -9,14 +9,12 @@ if PY3: # pragma: no cover
integer_types = int,
class_types = type,
text_type = str
binary_type = bytes
long = int
else:
string_types = basestring,
integer_types = (int, long)
class_types = (type, types.ClassType)
text_type = unicode
binary_type = str
long = long
def bytes_(s, encoding='latin-1', errors='strict'): #pragma NO COVER
......
......@@ -23,7 +23,6 @@ from zope.interface import implementer
from transaction.weakset import WeakSet
from transaction.interfaces import TransactionFailedError
from transaction import interfaces
from transaction._compat import binary_type
from transaction._compat import reraise
from transaction._compat import get_thread_ident
from transaction._compat import native_
......@@ -760,7 +759,7 @@ def text_or_warn(s):
return s
warnings.warn("Expected text", DeprecationWarning, stacklevel=3)
if isinstance(s, binary_type):
if isinstance(s, bytes):
return s.decode('utf-8', 'replace')
else:
return text_type(s)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment