summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/ofproto/ofproto_parser.py2
-rw-r--r--ryu/ofproto/oxx_fields.py2
-rw-r--r--ryu/tests/unit/packet/test_packet.py4
3 files changed, 4 insertions, 4 deletions
diff --git a/ryu/ofproto/ofproto_parser.py b/ryu/ofproto/ofproto_parser.py
index 1e553caa..670878d8 100644
--- a/ryu/ofproto/ofproto_parser.py
+++ b/ryu/ofproto/ofproto_parser.py
@@ -170,7 +170,7 @@ class MsgBase(StringifyMixin):
def __str__(self):
def hexify(x):
- return hex(x) if isinstance(x, int) else x
+ return hex(x) if isinstance(x, six.integer_types) else x
buf = 'version=%s,msg_type=%s,msg_len=%s,xid=%s,' %\
(hexify(self.version), hexify(self.msg_type),
hexify(self.msg_len), hexify(self.xid))
diff --git a/ryu/ofproto/oxx_fields.py b/ryu/ofproto/oxx_fields.py
index e1e47aaf..e9c1fb97 100644
--- a/ryu/ofproto/oxx_fields.py
+++ b/ryu/ofproto/oxx_fields.py
@@ -82,7 +82,7 @@ def _get_field_info_by_number(oxx, num_to_field, n):
name = f.name
except KeyError:
t = type_desc.UnknownType
- if isinstance(n, int):
+ if isinstance(n, six.integer_types):
name = 'field_%d' % (n,)
else:
raise KeyError('unknown %s field number: %s' % (oxx.upper(), n))
diff --git a/ryu/tests/unit/packet/test_packet.py b/ryu/tests/unit/packet/test_packet.py
index a793a5fa..c48e3727 100644
--- a/ryu/tests/unit/packet/test_packet.py
+++ b/ryu/tests/unit/packet/test_packet.py
@@ -697,7 +697,7 @@ class TestPacket(unittest.TestCase):
sctp_values = {'src_port': 1,
'dst_port': 1,
'vtag': 0,
- 'csum': p_sctp.csum,
+ 'csum': repr(p_sctp.csum),
'chunks': data_str}
_sctp_str = ','.join(['%s=%s' % (k, sctp_values[k])
for k, _ in inspect.getmembers(p_sctp)
@@ -1233,7 +1233,7 @@ class TestPacket(unittest.TestCase):
sctp_values = {'src_port': 1,
'dst_port': 1,
'vtag': 0,
- 'csum': p_sctp.csum,
+ 'csum': repr(p_sctp.csum),
'chunks': data_str}
_sctp_str = ','.join(['%s=%s' % (k, sctp_values[k])
for k, _ in inspect.getmembers(p_sctp)