diff options
author | cpopa <devnull@localhost> | 2014-02-22 19:56:43 +0200 |
---|---|---|
committer | cpopa <devnull@localhost> | 2014-02-22 19:56:43 +0200 |
commit | 9eb122e551730683463d8597aee90e28178c7bd2 (patch) | |
tree | df76c6f79c016ea906fe90a58dd949b6675a1143 | |
parent | bfe9eab8e6a30e864c29a45e2b6c4f37f98919f0 (diff) | |
download | pylint-9eb122e551730683463d8597aee90e28178c7bd2.tar.gz |
Syntax only valid for Python 3.3+.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | checkers/base.py | 8 | ||||
-rw-r--r-- | test/input/func_return_yield_mix_py_33.py (renamed from test/input/func_return_yield_mix_py_30.py) | 0 | ||||
-rw-r--r-- | test/messages/func_return_yield_mix_py_33.txt (renamed from test/messages/func_return_yield_mix_py_30.txt) | 0 |
4 files changed, 5 insertions, 5 deletions
@@ -27,7 +27,7 @@ ChangeLog for Pylint that abstract classes created with `abc` module and with abstract methods are instantied. - * Do not warn about 'return-arg-in-generator' in Python 3. + * Do not warn about 'return-arg-in-generator' in Python 3.3+. 2013-12-22 -- 1.1.0 * Add new check for use of deprecated pragma directives "pylint:disable-msg" diff --git a/checkers/base.py b/checkers/base.py index b9e3734..ef9210c 100644 --- a/checkers/base.py +++ b/checkers/base.py @@ -52,9 +52,9 @@ NO_REQUIRED_DOC_RGX = re.compile('__.*__') REVERSED_METHODS = (('__getitem__', '__len__'), ('__reversed__', )) -PY3K = sys.version_info > (3, 0) +PY33 = sys.version_info >= (3, 3) BAD_FUNCTIONS = ['map', 'filter', 'apply'] -if not PY3K: +if sys.version_info < (3, 0): BAD_FUNCTIONS.append('input') BAD_FUNCTIONS.append('file') @@ -243,7 +243,7 @@ class BasicErrorChecker(_BasicChecker): 'Used when a "return" statement with an argument is found ' 'outside in a generator function or method (e.g. with some ' '"yield" statements).', - {'maxversion': (3, 0)}), + {'maxversion': (3, 2)}), 'E0107': ("Use of the non-existent %s operator", 'nonexistent-operator', "Used when you attempt to use the C-style pre-increment or" @@ -294,7 +294,7 @@ class BasicErrorChecker(_BasicChecker): self.add_message('return-in-init', node=node) elif node.is_generator(): # make sure we don't mix non-None returns and yields - if not PY3K: + if not PY33: for retnode in returns: if isinstance(retnode.value, astroid.Const) and \ retnode.value.value is not None: diff --git a/test/input/func_return_yield_mix_py_30.py b/test/input/func_return_yield_mix_py_33.py index 1a3cd5d..1a3cd5d 100644 --- a/test/input/func_return_yield_mix_py_30.py +++ b/test/input/func_return_yield_mix_py_33.py diff --git a/test/messages/func_return_yield_mix_py_30.txt b/test/messages/func_return_yield_mix_py_33.txt index d81ce5c..d81ce5c 100644 --- a/test/messages/func_return_yield_mix_py_30.txt +++ b/test/messages/func_return_yield_mix_py_33.txt |