mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
python: Don't use StringIO directly.
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 <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
import re
|
||||
import StringIO
|
||||
import sys
|
||||
|
||||
import six
|
||||
@@ -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()
|
||||
|
Reference in New Issue
Block a user