Use cStringIO if available.

This attempts to import cStringIO then will fall back on the
six.StringIO import if cStringIO can't be found. This means on python2
we should get cStringIO if available otherwise we get the right StringIO
on both python2 and python3.

Change-Id: I046eb72f6b6ed4801ea43900d2516918fdefbe95
This commit is contained in:
Clark Boylan
2017-04-24 15:44:55 -07:00
parent 246201835f
commit 21a2c81e84

View File

@@ -28,7 +28,10 @@ import re
import select
import shutil
from six.moves import reload_module
from six import StringIO
try:
from cStringIO import StringIO
except Exception:
from six import StringIO
import socket
import string
import subprocess