patman: ImportError

Simon Glass sjg at chromium.org
Sun May 17 01:03:46 CEST 2020


Hi Stefan,

On Sat, 16 May 2020 at 05:27, Stefan Bosch <stefan_b at posteo.net> wrote:
>
> Hello,
>
> recently, I updated my local repository (U-Boot master). Last commit is
> c693f212c5b0433b3a49a89d87cbff28bf78eb87 now. Previously it has been
> 4df3578119b043d76b86b50077b06898fc2a4f62 (Date:   Wed Dec 18 18:25:42
> 2019 +0100).
>
> Now I get an "ImportError" if I call patman:
>
> u-boot_master$ ./tools/patman/patman --help
> Traceback (most recent call last):
>    File "./tools/patman/patman", line 21, in <module>
>      from patman import checkpatch
>    File
> "/home/stefan/u-boot_master/tools/patman/../patman/checkpatch.py", line
> 10, in <module>
>      from patman import command
>    File "/home/stefan/u-boot_master/tools/patman/../patman/command.py",
> line 8, in <module>
>      from patman import tools
>    File "/home/stefan/u-boot_master/tools/patman/../patman/tools.py",
> line 13, in <module>
>      from patman import command
> ImportError: cannot import name 'command'
>
> Cause of this 'ImportError' is probably that "from patman import
> command" has already been done before in checkpatch.py (circular
> dependency). I think the error has to do with your your commit
> bf776679a73f3b9eae37aabd2be5754483039cb2 (patman: Move to absolute imports).
>
> My Python version is 3.4.3.

The circular dependency has been there for some time, but perhaps in
Python 2, not Python 3. My Python is 3.6.9 or 3.7.7.

I sent a patch to break the circular dependency. Can you please try it
and see if it helps?

Regards,
Simon


More information about the U-Boot mailing list