[U-Boot] [U-Boot, v2, 4/8] test/py: Import StringIO from io module for python 3.x

Tom Rini trini at konsulko.com
Thu Sep 21 18:44:20 UTC 2017


On Thu, Sep 21, 2017 at 12:37:19PM -0600, Stephen Warren wrote:
> On 09/21/2017 10:38 AM, Paul Burton wrote:
> >Hi Tom,
> >
> >On Thursday, 21 September 2017 09:27:02 PDT Tom Rini wrote:
> >>On Thu, Sep 14, 2017 at 02:34:46PM -0700, Paul Burton wrote:
> >>>In python 3.x the StringIO module is gone, and instead StringIO can be
> >>>imported from the io module. Do this in order to run on python 3.x, and
> >>>fall back to importing StringIO as a module in order to continue working
> >>>with python 2.x.
> >>>
> >>>Signed-off-by: Paul Burton <paul.burton at imgtec.com>
> >>>Reviewed-by: Stephen Warren <swarren at nvidia.com>
> >>
> >>This breaks python2.7.  There we have both StringIO and io.StringIO so
> >>we succeed in 'from io import StringIO'.  But io.StringIO() needs
> >>unicode, and we don't have that by default in python2.  My quick attempt
> >>here failed.  Thanks!
> >
> >Hmm, in that case back to v1 for this patch? (ie. try the StringIO.StringIO
> >import first?)
> >
> >   https://patchwork.ozlabs.org/patch/813933/
> 
> If v1 works, that's fine by me too.

OK, thanks.  It does work and I'll grab just that.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170921/c44f79b7/attachment.sig>


More information about the U-Boot mailing list