I am getting a syntax error in a python file and I'm really new to python.
if o in ('-r', '--revision'):
doupdate = True
开发者_如何学编程 a = a.upper()
if a in ('HEAD', 'PREV'):
rev = 0 if (a == 'HEAD') else -1
else:
try:
rev = int(a)
except ValueError:
om.out.error("Invalid value for revision number. Expected int.")
return -3
# console
This is not all of the file.. The bad line is rev = 0 if (a == 'HEAD') else -1
Thanks
You must be using an old version of Python.
The if-expression was added in 2.5.
Your code compiles fine for me.
精彩评论