docker: docker.py wrap StringIO import for python3
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 20 Jun 2018 14:45:42 +0000 (15:45 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 20 Jun 2018 15:57:34 +0000 (16:57 +0100)
Although the docker.py is nominally python2 we actually invoke it with
the configured python from the configure script.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
tests/docker/docker.py

index 306e14cf69440ec5ae3f6d808548936c603decec..e4095270eb10b0a80fd560291da7cbdfd110a592 100755 (executable)
@@ -26,7 +26,10 @@ import tempfile
 import re
 import signal
 from tarfile import TarFile, TarInfo
-from StringIO import StringIO
+try:
+    from StringIO import StringIO
+except ImportError:
+    from io import StringIO
 from shutil import copy, rmtree
 from pwd import getpwuid