diff --git a/secop/datatypes.py b/secop/datatypes.py index 7617da6..19a1b8f 100644 --- a/secop/datatypes.py +++ b/secop/datatypes.py @@ -328,7 +328,7 @@ class EnumType(DataType): return {'type': 'enum', 'members':dict((m.name, m.value) for m in self._enum.members)} def __repr__(self): - return u"EnumType(%r, %s)" % (self._enum.name, ', '.join('%s=%d' %(m.name, m.value) for m in self._enum.members)) + return "EnumType(%r, %s)" % (self._enum.name, ', '.join('%s=%d' %(m.name, m.value) for m in self._enum.members)) def export_value(self, value): """returns a python object fit for serialisation""" @@ -843,7 +843,7 @@ class OrType(DataType): return t(value) except Exception: pass - raise BadValueError(u"Invalid Value, must conform to one of %s" % (', '.join((str(t) for t in self.types)))) + raise BadValueError("Invalid Value, must conform to one of %s" % (', '.join((str(t) for t in self.types)))) Int8 = IntRange(-(1 << 7), (1 << 7) - 1) diff --git a/secop/params.py b/secop/params.py index 4f0e0a5..3670d08 100644 --- a/secop/params.py +++ b/secop/params.py @@ -232,7 +232,7 @@ class Override(CountedObj): return type(obj)(ctr=self.ctr, **props) return type(obj)(**props) raise ProgrammingError( - u"Overrides can only be applied to Accessibles, %r is none!" % + "Overrides can only be applied to Accessibles, %r is none!" % obj) diff --git a/secop/protocol/messages.py b/secop/protocol/messages.py index ed42a06..561d859 100644 --- a/secop/protocol/messages.py +++ b/secop/protocol/messages.py @@ -80,7 +80,7 @@ REQUEST2REPLY = { -HelpMessage = u"""Try one of the following: +HelpMessage = """Try one of the following: '%s' to query protocol version '%s' to read the description '%s [:]' to request reading a value diff --git a/test/test_datatypes.py b/test/test_datatypes.py index 0fd9c2a..5002fd5 100644 --- a/test/test_datatypes.py +++ b/test/test_datatypes.py @@ -306,8 +306,8 @@ def test_BoolType(): with pytest.raises(ValueError): dt.import_value('av') - assert dt.format_value(0) == u"False" - assert dt.format_value(True) == u"True" + assert dt.format_value(0) == "False" + assert dt.format_value(True) == "True" def test_ArrayOf(): @@ -361,7 +361,7 @@ def test_TupleOf(): assert dt.export_value([1, True]) == [1, True] assert dt.import_value([1, True]) == [1, True] - assert dt.format_value([3,0]) == u"(3, False)" + assert dt.format_value([3,0]) == "(3, False)" def test_StructOf(): @@ -393,7 +393,7 @@ def test_StructOf(): assert dt.import_value({'an_int': 13, 'a_string': 'WFEC'}) == { 'a_string': 'WFEC', 'an_int': 13} - assert dt.format_value({'an_int':2, 'a_string':'Z'}) == u"{a_string='Z', an_int=2}" + assert dt.format_value({'an_int':2, 'a_string':'Z'}) == "{a_string='Z', an_int=2}" def test_Command():