Skip to content

Commit

Permalink
python: Don't use StringIO directly.
Browse files Browse the repository at this point in the history
StringIO.StringIO in Python 2 became io.StringIO in Python 3.  Use
six.StringIO which is an alias for the two cases.

Signed-off-by: Russell Bryant <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
russellb committed Feb 2, 2016
1 parent 58de9fc commit 981e956
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/ovs/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import re
import StringIO
import sys

import six
Expand Down Expand Up @@ -122,7 +121,7 @@ def to_file(obj, name, pretty=False, sort_keys=True):


def to_string(obj, pretty=False, sort_keys=True):
output = StringIO.StringIO()
output = six.StringIO()
to_stream(obj, output, pretty, sort_keys)
s = output.getvalue()
output.close()
Expand Down

0 comments on commit 981e956

Please sign in to comment.