From: Stefan Bosch Date: Sun, 17 May 2020 15:55:15 +0200 Subject: patman: ImportError In-Reply-To: References: <2e8ee9ea-7aa3-478c-81d1-80f5ef37849c@posteo.net> Message-ID: <1252c799-aafa-decb-88c1-4e325d414271@posteo.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, Am 17.05.20 um 01:03 schrieb Simon Glass: > Hi Stefan, > > On Sat, 16 May 2020 at 05:27, Stefan Bosch 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 >> from patman import checkpatch >> File >> "/home/stefan/u-boot_master/tools/patman/../patman/checkpatch.py", line >> 10, in >> from patman import command >> File "/home/stefan/u-boot_master/tools/patman/../patman/command.py", >> line 8, in >> from patman import tools >> File "/home/stefan/u-boot_master/tools/patman/../patman/tools.py", >> line 13, in >> 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 > Thanks for your quick reply. I tried your patch, the good news is that the ImportError for 'command' has been gone. The bad news is that the same occurs for 'checkpatch' now: $ ./tools/patman/patman --help Traceback (most recent call last): File "./tools/patman/patman", line 21, in from patman import checkpatch File "/home/stefan/u-boot_master/tools/patman/../patman/checkpatch.py", line 11, in from patman import gitutil File "/home/stefan/u-boot_master/tools/patman/../patman/gitutil.py", line 10, in from patman import checkpatch ImportError: cannot import name 'checkpatch' Regards, Stefan