diff --git a/contrib/check-code.py b/contrib/check-code.py index fb7b9a765bb9fe6e2e9cc05493f77ba02359fa66_Y29udHJpYi9jaGVjay1jb2RlLnB5..3b5cd6f13dccf771078e632fb2e3fb9e215faaf1_Y29udHJpYi9jaGVjay1jb2RlLnB5 100755 --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -243,8 +243,8 @@ # (r'^\s*print\s+', "avoid using print in core and extensions"), (r'[\x80-\xff]', "non-ASCII character literal"), (r'("\')\.format\(', "str.format() not available in Python 2.4"), - (r'(?<!def)\s+(any|all|format)\(', - "any/all/format not available in Python 2.4", 'no-py24'), + (r'(?<!def)\s+(all|format)\(', + "all/format not available in Python 2.4", 'no-py24'), (r'if\s.*\selse', "if ... else form not available in Python 2.4"), (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist), "gratuitous whitespace after Python keyword"), diff --git a/tests/test-check-code.t b/tests/test-check-code.t index fb7b9a765bb9fe6e2e9cc05493f77ba02359fa66_dGVzdHMvdGVzdC1jaGVjay1jb2RlLnQ=..3b5cd6f13dccf771078e632fb2e3fb9e215faaf1_dGVzdHMvdGVzdC1jaGVjay1jb2RlLnQ= 100644 --- a/tests/test-check-code.t +++ b/tests/test-check-code.t @@ -19,7 +19,7 @@ > EOF $ cat > non-py24.py <<EOF > # Using builtins that does not exist in Python 2.4 - > if any(): + > if True: > x = all() > y = format(x) > @@ -23,10 +23,6 @@ > x = all() > y = format(x) > - > # Do not complain about our own definition - > def any(x): - > pass - > > # try/except/finally block does not exist in Python 2.4 > try: > pass @@ -85,8 +81,5 @@ ./quote.py:5: > '"""', 42+1, """and missing whitespace in expression - ./non-py24.py:2: - > if any(): - any/all/format not available in Python 2.4 ./non-py24.py:3: > x = all() @@ -91,5 +84,5 @@ ./non-py24.py:3: > x = all() - any/all/format not available in Python 2.4 + all/format not available in Python 2.4 ./non-py24.py:4: > y = format(x) @@ -94,6 +87,6 @@ ./non-py24.py:4: > y = format(x) - any/all/format not available in Python 2.4 - ./non-py24.py:28: + all/format not available in Python 2.4 + ./non-py24.py:24: > try: no yield inside try/finally in Python 2.4 @@ -98,6 +91,6 @@ > try: no yield inside try/finally in Python 2.4 - ./non-py24.py:33: + ./non-py24.py:29: > try: no yield inside try/finally in Python 2.4 ./classstyle.py:4: