summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorfumihiko kakuma <kakuma@valinux.co.jp>2015-06-29 16:00:57 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-06-29 22:09:14 +0900
commit4099aec69a3ccc9aeb86e81cd5c389a69688a39b (patch)
treec4f3461982d811277c0351cd55f1d32e111b7502
parent815dc505b750ed7ea61d01ee7eaf767de6b377cc (diff)
python3: Modify a literal argument in a bytes method call to bytes type
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/ofproto_v1_2_parser.py6
-rw-r--r--ryu/tests/unit/ofproto/test_parser_v12.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py
index 7ecce123..b528181f 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -333,7 +333,7 @@ class OFPPort(ofproto_parser.namedtuple('OFPPort', (
i = cls._fields.index('hw_addr')
port[i] = addrconv.mac.bin_to_text(port[i])
i = cls._fields.index('name')
- port[i] = port[i].rstrip('\0')
+ port[i] = port[i].rstrip(b'\0')
return cls(*port)
@@ -1985,7 +1985,7 @@ class OFPDescStats(ofproto_parser.namedtuple('OFPDescStats', (
desc = struct.unpack_from(ofproto.OFP_DESC_STATS_PACK_STR,
buf, offset)
desc = list(desc)
- desc = [x.rstrip('\0') for x in desc]
+ desc = [x.rstrip(b'\0') for x in desc]
stats = cls(*desc)
stats.length = ofproto.OFP_DESC_STATS_SIZE
return stats
@@ -2375,7 +2375,7 @@ class OFPTableStats(
buf, offset)
table = list(table)
i = cls._fields.index('name')
- table[i] = table[i].rstrip('\0')
+ table[i] = table[i].rstrip(b'\0')
stats = cls(*table)
stats.length = ofproto.OFP_TABLE_STATS_SIZE
return stats
diff --git a/ryu/tests/unit/ofproto/test_parser_v12.py b/ryu/tests/unit/ofproto/test_parser_v12.py
index ccffcac4..f3645bdb 100644
--- a/ryu/tests/unit/ofproto/test_parser_v12.py
+++ b/ryu/tests/unit/ofproto/test_parser_v12.py
@@ -4985,7 +4985,7 @@ class TestOFPTableStats(unittest.TestCase):
res = OFPTableStats.parser(buf, 0)
eq_(table_id, res.table_id)
- eq_(name, res.name.replace(b'\x00', ''))
+ eq_(name, res.name.replace(b'\x00', b''))
eq_(match, res.match)
eq_(wildcards, res.wildcards)
eq_(write_actions, res.write_actions)