mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-02 01:20:47 +09:00
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>
This commit is contained in:
parent
e6d85ff9f2
commit
ade1e3864f
@ -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()]
|
||||
|
Loading…
Reference in New Issue
Block a user