Skip to content

Commit

Permalink
Allow to pass None and integers as transaction-notes
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer committed Feb 1, 2017
1 parent f91dd86 commit a2435bf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions transaction/_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from transaction._compat import native_
from transaction._compat import bytes_
from transaction._compat import StringIO
from transaction._compat import text_type
from transaction._compat import binary_type

_marker = object()

Expand Down Expand Up @@ -135,7 +135,7 @@ def user(self):

@user.setter
def user(self, v):
if not isinstance(v, text_type):
if isinstance(v, binary_type):
raise TypeError("User must be text (unicode)")
self._user = v

Expand All @@ -145,7 +145,7 @@ def description(self):

@description.setter
def description(self, v):
if not isinstance(v, text_type):
if isinstance(v, binary_type):
raise TypeError("Description must be text (unicode)")
self._description = v

Expand Down Expand Up @@ -533,7 +533,7 @@ def abort(self):
def note(self, text):
""" See ITransaction.
"""
if not isinstance(text, text_type):
if isinstance(text, binary_type):
raise TypeError("Note must be text (unicode)")

text = text.strip()
Expand All @@ -545,9 +545,9 @@ def note(self, text):
def setUser(self, user_name, path=u"/"):
""" See ITransaction.
"""
if not isinstance(user_name, text_type):
if isinstance(user_name, binary_type):
raise TypeError("User name must be text (unicode)")
if not isinstance(path, text_type):
if isinstance(path, binary_type):
raise TypeError("Path must be text (unicode)")
self.user = u"%s %s" % (path, user_name)

Expand Down

1 comment on commit a2435bf

@pbauer
Copy link
Member Author

@pbauer pbauer commented on a2435bf Feb 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be obsolete after zopefoundation/Zope@e8a1b47

Please sign in to comment.