summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/vpp_format.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2020-12-02 14:34:27 -0500
committerOle Tr�an <otroan@employees.org>2020-12-03 14:12:09 +0000
commitd7adc293d377f4691b0285f62363c3958c68d235 (patch)
tree83839c8d66cf342f460aa808cfcbfacf08f9fff1 /src/vpp-api/python/vpp_papi/vpp_format.py
parent5395c6a07996b9d852ce1e942bd2b3c094b89d27 (diff)
papi: remove python2 patterns
Type: refactor Change-Id: I541759b4b788acf08599661eb9e7abc58e9283d2 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_format.py')
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_format.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_format.py b/src/vpp-api/python/vpp_papi/vpp_format.py
index 261683d5816..0b85eb4fcb6 100644
--- a/src/vpp-api/python/vpp_papi/vpp_format.py
+++ b/src/vpp-api/python/vpp_papi/vpp_format.py
@@ -18,10 +18,6 @@ import socket
import ipaddress
from . import macaddress
-try:
- text_type = unicode
-except NameError:
- text_type = str
# Copies from vl_api_address_t definition
ADDRESS_IP4 = 0
@@ -51,7 +47,7 @@ def format_vl_api_address_t(args):
def format_vl_api_prefix_t(args):
if isinstance(args, (ipaddress.IPv4Network, ipaddress.IPv6Network)):
return {'address': format_vl_api_address_t(
- text_type(args.network_address)),
+ str(args.network_address)),
'len': int(args.prefixlen)}
p, length = args.split('/')
return {'address': format_vl_api_address_t(p),
@@ -61,7 +57,7 @@ def format_vl_api_prefix_t(args):
def format_vl_api_address_with_prefix_t(args):
if isinstance(args, (ipaddress.IPv4Interface, ipaddress.IPv6Interface)):
return {'address': format_vl_api_address_t(
- text_type(args.network_address)),
+ str(args.network_address)),
'len': int(args.prefixlen)}
p, length = args.split('/')
return {'address': format_vl_api_address_t(p),