remove more py2 relicts
some u"" (double quotes) were not found in change before Change-Id: I85912892bbe7b57afee758c69d1aa7073557adc0 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21326 Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de> Reviewed-by: Bjoern Pedersen <bjoern.pedersen@frm2.tum.de> Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
parent
c0233b5d6c
commit
9fce31c4f3
@ -328,7 +328,7 @@ class EnumType(DataType):
|
|||||||
return {'type': 'enum', 'members':dict((m.name, m.value) for m in self._enum.members)}
|
return {'type': 'enum', 'members':dict((m.name, m.value) for m in self._enum.members)}
|
||||||
|
|
||||||
def __repr__(self):
|
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):
|
def export_value(self, value):
|
||||||
"""returns a python object fit for serialisation"""
|
"""returns a python object fit for serialisation"""
|
||||||
@ -843,7 +843,7 @@ class OrType(DataType):
|
|||||||
return t(value)
|
return t(value)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
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)
|
Int8 = IntRange(-(1 << 7), (1 << 7) - 1)
|
||||||
|
@ -232,7 +232,7 @@ class Override(CountedObj):
|
|||||||
return type(obj)(ctr=self.ctr, **props)
|
return type(obj)(ctr=self.ctr, **props)
|
||||||
return type(obj)(**props)
|
return type(obj)(**props)
|
||||||
raise ProgrammingError(
|
raise ProgrammingError(
|
||||||
u"Overrides can only be applied to Accessibles, %r is none!" %
|
"Overrides can only be applied to Accessibles, %r is none!" %
|
||||||
obj)
|
obj)
|
||||||
|
|
||||||
|
|
||||||
|
@ -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 query protocol version
|
||||||
'%s' to read the description
|
'%s' to read the description
|
||||||
'%s <module>[:<parameter>]' to request reading a value
|
'%s <module>[:<parameter>]' to request reading a value
|
||||||
|
@ -306,8 +306,8 @@ def test_BoolType():
|
|||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
dt.import_value('av')
|
dt.import_value('av')
|
||||||
|
|
||||||
assert dt.format_value(0) == u"False"
|
assert dt.format_value(0) == "False"
|
||||||
assert dt.format_value(True) == u"True"
|
assert dt.format_value(True) == "True"
|
||||||
|
|
||||||
|
|
||||||
def test_ArrayOf():
|
def test_ArrayOf():
|
||||||
@ -361,7 +361,7 @@ def test_TupleOf():
|
|||||||
assert dt.export_value([1, True]) == [1, True]
|
assert dt.export_value([1, True]) == [1, True]
|
||||||
assert dt.import_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():
|
def test_StructOf():
|
||||||
@ -393,7 +393,7 @@ def test_StructOf():
|
|||||||
assert dt.import_value({'an_int': 13, 'a_string': 'WFEC'}) == {
|
assert dt.import_value({'an_int': 13, 'a_string': 'WFEC'}) == {
|
||||||
'a_string': 'WFEC', 'an_int': 13}
|
'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():
|
def test_Command():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user