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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user