[U-Boot] [PATCH 0/9] Python 3.x support for patman & dtoc

Simon Glass sjg at chromium.org
Tue Sep 27 19:55:15 CEST 2016


Hi Paul,

On 27 September 2016 at 09:07, Paul Burton <paul.burton at imgtec.com> wrote:
> On Monday, 26 September 2016 18:33:19 BST Simon Glass wrote:
>> Hi Paul,
>>
>> On 26 September 2016 at 08:30, Paul Burton <paul.burton at imgtec.com> wrote:
>> > This series makes patman & dtoc run on python 3.x, which allows them to
>> > work without hacks on distributions where the python binary is python
>> > 3.x. All changes are made in a way that continue to work on python 2.x,
>> > so both tools should work on either major version of python.
>>
>> Thanks for doing this! Does it still install correctly with setup.py?
>
> Hi Simon,
>
> No problem - I've been meaning to for a while!
>
> It seems to install fine when using python2 (& neat, I hadn't noticed there was
> an installer before). When using python3 it installs fine but then when running
> it imports fail with messages like:
>
>>>> from patman import settings
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/home/pburton/.local/lib/python3.5/site-packages/patman/settings.py",
> line 16, in <module>
>    import command
> ImportError: No module named 'command'
>
> I'm not sure what the best way to fix that is. We could import in all files the
> way patman.py does, wrapped in a try except block (though should that go the
> other way round to what it is now? ie. won't it currently always import the
> installed version even if you run patman from the source tree?) Alternatively
> we could run patman using a wrapper script in tools/ or move all the patman
> source a level down & have a wrapper script in tools/patman/ then use "from
> patman import x" in all cases. Any preferences?
>

Is it possible to update sys.path instead?

[...]

Regards,
Simon


More information about the U-Boot mailing list