check-code: un-ban any() now that we're on 2.6
authorAugie Fackler <augie@google.com>
Sat, 16 May 2015 14:31:03 -0400
changeset 25148 3b5cd6f13dcc
parent 25147 fb7b9a765bb9
child 25149 3f0744eeaeaf
check-code: un-ban any() now that we're on 2.6
contrib/check-code.py
tests/test-check-code.t
--- a/contrib/check-code.py	Sun May 17 18:11:02 2015 -0700
+++ b/contrib/check-code.py	Sat May 16 14:31:03 2015 -0400
@@ -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"),
--- a/tests/test-check-code.t	Sun May 17 18:11:02 2015 -0700
+++ b/tests/test-check-code.t	Sat May 16 14:31:03 2015 -0400
@@ -19,14 +19,10 @@
   > 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)
   > 
-  > # 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,19 +81,16 @@
   ./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()
-   any/all/format not available in Python 2.4
+   all/format not available in Python 2.4
   ./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
-  ./non-py24.py:33:
+  ./non-py24.py:29:
    >     try:
    no yield inside try/finally in Python 2.4
   ./classstyle.py:4: