aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_interface.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-24 21:46:05 -0800
committerDamjan Marion <dmarion@me.com>2019-02-26 11:31:42 +0000
commit3bce8ebfdfaf2a4b576012beb3516d1f4030c20c (patch)
treead221819ad353c04e70a021978e50522a4b66998 /test/vpp_interface.py
parentdd3737284d5021e2e3bd0413b61aab14797e365c (diff)
VPP-1508 Python3 abstract classes
Update the syntax to support abstract classes in python 2 and python 3. Depends on: new style classes -- https://gerrit.fd.io/r/16166 Change-Id: Iad2c1240149f38b3faca1b37ab95d3d210e1daee Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/vpp_interface.py')
-rw-r--r--test/vpp_interface.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/vpp_interface.py b/test/vpp_interface.py
index 58384d2eeb9..2dcf149a593 100644
--- a/test/vpp_interface.py
+++ b/test/vpp_interface.py
@@ -1,16 +1,17 @@
import binascii
import socket
-from abc import abstractmethod, ABCMeta
+import abc
+import six
from six import moves
from util import Host, mk_ll_addr
from vpp_papi import mac_ntop
+@six.add_metaclass(abc.ABCMeta)
class VppInterface(object):
"""Generic VPP interface."""
- __metaclass__ = ABCMeta
@property
def sw_if_index(self):
@@ -181,7 +182,7 @@ class VppInterface(object):
self._hosts_by_ip4[ip4] = host
self._hosts_by_ip6[ip6] = host
- @abstractmethod
+ @abc.abstractmethod
def __init__(self, test):
self._test = test