From 1ccbf95c6eaccb371227dd58455163840d6cc2d0 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Mon, 14 Dec 2015 17:21:26 -0500 Subject: [PATCH] python: Drop use of types.StringTypes. types.StringTypes does not exist in Python 3. We can use six.string_types, instead. Signed-off-by: Russell Bryant Acked-by: Ben Pfaff --- python/ovs/unixctl/__init__.py | 4 +++- python/ovs/unixctl/client.py | 5 +++-- python/ovs/unixctl/server.py | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/python/ovs/unixctl/__init__.py b/python/ovs/unixctl/__init__.py index c6484c44679..26e126a9784 100644 --- a/python/ovs/unixctl/__init__.py +++ b/python/ovs/unixctl/__init__.py @@ -14,10 +14,12 @@ import types +import six + import ovs.util commands = {} -strtypes = types.StringTypes +strtypes = six.string_types class _UnixctlCommand(object): diff --git a/python/ovs/unixctl/client.py b/python/ovs/unixctl/client.py index be6dee4dd19..1b247c4cd5e 100644 --- a/python/ovs/unixctl/client.py +++ b/python/ovs/unixctl/client.py @@ -13,7 +13,8 @@ # limitations under the License. import os -import types + +import six import ovs.jsonrpc import ovs.stream @@ -21,7 +22,7 @@ vlog = ovs.vlog.Vlog("unixctl_client") -strtypes = types.StringTypes +strtypes = six.string_types class UnixctlClient(object): diff --git a/python/ovs/unixctl/server.py b/python/ovs/unixctl/server.py index 4ea19a1fe79..cc712bf410d 100644 --- a/python/ovs/unixctl/server.py +++ b/python/ovs/unixctl/server.py @@ -15,7 +15,6 @@ import copy import errno import os -import types import six from six.moves import range @@ -30,7 +29,7 @@ Message = ovs.jsonrpc.Message vlog = ovs.vlog.Vlog("unixctl_server") -strtypes = types.StringTypes +strtypes = six.string_types class UnixctlConnection(object):