diff options
author | Simon Glass | 2019-05-14 15:53:49 -0600 |
---|---|---|
committer | Simon Glass | 2019-07-10 16:52:58 -0600 |
commit | ade1e3864f1508ad0ccbce72a39d815c2d7d7c87 (patch) | |
tree | 580ccef33eb1b0b2da5602ddb56099a444730422 /tools/patman | |
parent | e6d85ff9f239a338748871b93ed11f066609e869 (diff) |
patman: Support use of stringIO in Python 3
With Python 3 this class has moved. Update the code to handle both cases.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman')
-rw-r--r-- | tools/patman/func_test.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index 31481157fc5..2c4392dbc10 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()] |