From 95f2491ed89ac99b0d8bd006b4a13cbeb1eb96ce Mon Sep 17 00:00:00 2001 From: "Michael S. Pedersen" Date: Tue, 3 Dec 2019 11:38:32 +0000 Subject: NFVBENCH-153 Add support for python3 JIRA: NFVBENCH-153 Done using 2to3-3.6 with additional changes to fix data parsing and testing (tox) Signed-off-by: Michael S. Pedersen Change-Id: I242902f800da543d780507828c9bd1fbf409da6d --- nfvbench/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nfvbench/utils.py') diff --git a/nfvbench/utils.py b/nfvbench/utils.py index ecbb55a..3974fd7 100644 --- a/nfvbench/utils.py +++ b/nfvbench/utils.py @@ -23,7 +23,7 @@ import errno import fcntl from functools import wraps import json -from log import LOG +from .log import LOG class TimeoutError(Exception): @@ -74,7 +74,7 @@ def save_json_result(result, json_file, std_json_path, service_chain, service_ch def byteify(data, ignore_dicts=False): # if this is a unicode string, return its string representation - if isinstance(data, unicode): + if isinstance(data, str): return data.encode('utf-8') # if this is a list of values, return list of byteified values if isinstance(data, list): @@ -83,7 +83,7 @@ def byteify(data, ignore_dicts=False): # but only if we haven't already byteified it if isinstance(data, dict) and not ignore_dicts: return {byteify(key, ignore_dicts=ignore_dicts): byteify(value, ignore_dicts=ignore_dicts) - for key, value in data.iteritems()} + for key, value in list(data.items())} # if it's anything else, return it in its original form return data -- cgit 1.2.3-korg