Skip to content

Commit

Permalink
No need for binary type
Browse files Browse the repository at this point in the history
  • Loading branch information
jimfulton committed Mar 10, 2017
1 parent 0398429 commit 752e4d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions transaction/_compat.py
Expand Up @@ -9,14 +9,12 @@
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
Expand Down
3 changes: 1 addition & 2 deletions transaction/_transaction.py
Expand Up @@ -23,7 +23,6 @@
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_
Expand Down Expand Up @@ -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)

0 comments on commit 752e4d2

Please sign in to comment.