Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bernhard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from . import pb

string_type = str
if sys.version_info[1] < 3:
if sys.version_info.major < 3:
string_type = basestring

class TransportError(Exception):
Expand Down Expand Up @@ -155,8 +155,8 @@ def __setattr__(self, name, value):
if isinstance(val, bytes):
val = val.decode('utf-8')
elif not isinstance(val, string_type):
val = string_type(val)
a.value = string_type(val)
val = str(val)
a.value = val
else:
raise TypeError("'attributes' parameter must be type 'dict'")
elif name in set(f.name for f in pb.Event.DESCRIPTOR.fields):
Expand Down