From: Simon Glass Date: Tue, 14 May 2019 15:53:49 -0600 Subject: [U-Boot] [PATCH 15/21] patman: Support use of stringIO in Python 3 In-Reply-To: <20190514215355.246399-1-sjg@chromium.org> References: <20190514215355.246399-1-sjg@chromium.org> Message-ID: <20190514215355.246399-16-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de With Python 3 this class has moved. Update the code to handle both cases. Signed-off-by: Simon Glass --- tools/patman/func_test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index 31481157fc..2c4392dbc1 100644 --- a/tools/patman/func_test.py +++ b/tools/patman/func_test.py @@ -12,15 +12,20 @@ import sys import tempfile import unittest +try: + from StringIO import StringIO +except ImportError: + from io import StringIO + import gitutil import patchstream import settings +import tools @contextlib.contextmanager def capture(): import sys - from cStringIO import StringIO oldout,olderr = sys.stdout, sys.stderr try: out=[StringIO(), StringIO()] -- 2.21.0.1020.gf2820cf01a-goog