[U-Boot] [PATCH 15/21] patman: Support use of stringIO in Python 3

Simon Glass sjg at chromium.org
Tue May 14 21:53:49 UTC 2019


With Python 3 this class has moved. Update the code to handle both cases.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 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



More information about the U-Boot mailing list