开发者

python syntax error w3af

开发者 https://www.devze.com 2023-03-30 18:02 出处:网络
I am getting a syntax error in a python file and I\'m really new to python. if o in (\'-r\', \'--revision\'):

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消