Show More
@@ -92,7 +92,7 b' pypats = [' | |||||
92 | (r'[\x80-\xff]', "non-ASCII character literal"), |
|
92 | (r'[\x80-\xff]', "non-ASCII character literal"), | |
93 | (r'("\')\.format\(', "str.format() not available in Python 2.4"), |
|
93 | (r'("\')\.format\(', "str.format() not available in Python 2.4"), | |
94 | (r'^\s*with\s+', "with not available in Python 2.4"), |
|
94 | (r'^\s*with\s+', "with not available in Python 2.4"), | |
95 |
(r' |
|
95 | (r'(?<!def)\s+(any|all)\(', "any/all not available in Python 2.4"), | |
96 | (r'if\s.*\selse', "if ... else form not available in Python 2.4"), |
|
96 | (r'if\s.*\selse', "if ... else form not available in Python 2.4"), | |
97 | (r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"), |
|
97 | (r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"), | |
98 | # (r'\s\s=', "gratuitous whitespace before ="), |
|
98 | # (r'\s\s=', "gratuitous whitespace before ="), |
@@ -22,5 +22,15 b' but """\\\\\'\'\' and finally\'\'\',' | |||||
22 | a, '\\\\\\\\', "\\\\\\" x-2", "c-1" |
|
22 | a, '\\\\\\\\', "\\\\\\" x-2", "c-1" | |
23 | EOF |
|
23 | EOF | |
24 |
|
24 | |||
|
25 | cat > non-py24.py <<EOF | |||
|
26 | # Using builtins that does not exist in Python 2.4 | |||
|
27 | if any(): | |||
|
28 | x = all() | |||
|
29 | ||||
|
30 | # Do not complain about our own definition | |||
|
31 | def any(x): | |||
|
32 | pass | |||
|
33 | EOF | |||
|
34 | ||||
25 | check_code=`dirname $0`/../contrib/check-code.py |
|
35 | check_code=`dirname $0`/../contrib/check-code.py | |
26 | ${check_code} ./wrong.py ./correct.py ./quote.py |
|
36 | ${check_code} ./wrong.py ./correct.py ./quote.py ./non-py24.py |
@@ -11,3 +11,9 b'' | |||||
11 | ./quote.py:5: |
|
11 | ./quote.py:5: | |
12 | > '"""', 42+1, """and |
|
12 | > '"""', 42+1, """and | |
13 | missing whitespace in expression |
|
13 | missing whitespace in expression | |
|
14 | ./non-py24.py:2: | |||
|
15 | > if any(): | |||
|
16 | any/all not available in Python 2.4 | |||
|
17 | ./non-py24.py:3: | |||
|
18 | > x = all() | |||
|
19 | any/all not available in Python 2.4 |
General Comments 0
You need to be logged in to leave comments.
Login now