Mercurial > hg-stable
changeset 25140:317333e0793c
check-code: fix the error message about 'class foo():'
Using 'classs foo():' result in old style object instead of new style object. We
do not want old style object so this check is unrelated to 2.4.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sun, 17 May 2015 17:40:26 -0700 |
parents | 6d3079e9b53f |
children | 3ea8d6b5e665 |
files | contrib/check-code.py tests/test-check-code.t |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Sun May 17 17:36:26 2015 -0700 +++ b/contrib/check-code.py Sun May 17 17:40:26 2015 -0700 @@ -234,7 +234,7 @@ "linebreak after :"), (r'class\s[^( \n]+:', "old-style class, use class foo(object)"), (r'class\s[^( \n]+\(\):', - "class foo() not available in Python 2.4, use class foo(object)"), + "class foo() creates old style object, use class foo(object)"), (r'\b(%s)\(' % '|'.join(k for k in keyword.kwlist if k not in ('print', 'exec')), "Python keyword is not a function"),
--- a/tests/test-check-code.t Sun May 17 17:36:26 2015 -0700 +++ b/tests/test-check-code.t Sun May 17 17:40:26 2015 -0700 @@ -115,7 +115,7 @@ old-style class, use class foo(object) ./classstyle.py:7: > class empty(): - class foo() not available in Python 2.4, use class foo(object) + class foo() creates old style object, use class foo(object) [1] $ cat > python3-compat.py << EOF > foo <> bar