repo:SyntaxError: invalid syntax

created at 06-13-2022 views: 8

problem track

Execute the command

# repo forall -c git checkout android-12.0.0_r31

The error is as follows:

File "aosp/.repo/repo/main.py", line 79
     file=sys.stderr)
         ^
SyntaxError: invalid syntax

solution

Reason: It is a syntax problem of the python2.xxx version, just use python3 to execute

# python3 /usr/bin/repo forall -c git checkout android-12.0.0_r31
created at:06-13-2022
edited at: 06-13-2022: