Hi @WayneWWW ,
I am using Ubuntu 20.04 and my python version is 3.8.10.
While flashing i am seeing this warning prints,
Linux_for_Tegra/bootloader/tegraflash_internal.py:1978: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
if sig_type is not “zerosbk”:
Linux_for_Tegra/bootloader/tegraflash_internal.py:1981: SyntaxWarning: “is” with a literal. Did you mean “==”?
if sig_type is “oem-rsa”:
Linux_for_Tegra/bootloader/tegraflash_internal.py:2416: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
while count is not 0 and not check_ismb2():
Linux_for_Tegra/bootloader/tegraflash_internal.py:2425: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
while count is not 0:
I think in the python scripts there has been a confusion with “is” and “==” and other literals and they are not used correctly.
So if you type python python 2 gets called and Nvidia tools are happy. I regularly flash AGX Xavier boards from Ubuntu 20.04 and Debian 11 without issue with this workaround.
then you can easily switch between the default python with
sudo update-alternatives --config python
so you can quickly switch which python version gets called when just typing python.
Most syntax issues are very small and could easily be fixed, most of them are just missing parenthesis on print statements which are now functions (cleaning it up will keep it working with python 2 as well). One file uses a package that changed name between python 2 and 3 to be PEP8 compliant. That would be an easy fix as well and could easily be done in a way compatible with both python 2 and 3. But for now, as there are many small fixes to do, i didn’t bother fixing the scripts i just switched to python 2 default when working with Nvidia tools.