You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from __future__ importannotationsfromcollectionsimportnamedtupleclassSomeClass(namedtuple("SomeClass", [])):
defmethod(self) ->SomeClass:
pass
Run pylint against it:
$ pylint -d C0114,C0115,C0116 test.py
Expected
pylint succeeds
worked as expected with pylint==2.12.2 and earlier versions of pylint
Actual
Exception on node <Name.SomeClass l.7 at 0x112389a10> in file '/private/tmp/pylintfail/crash_pylint.py'
Traceback (most recent call last):
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/utils/ast_walker.py", line 73, in walk
callback(astroid)
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 1362, in visit_name
self._undefined_and_used_before_checker(node, stmt)
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 1405, in _undefined_and_used_before_checker
node, stmt, frame, current_consumer, i, base_scope_type
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 1595, in _check_consumer
is_recursive_klass,
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 1866, in _is_variable_violation
maybe_before_assign = _detect_global_scope(node, frame, defframe)
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 262, in _detect_global_scope
return frame.lineno < defframe.lineno
TypeError: '<' not supported between instances of 'int' and 'NoneType'
************* Module crash_pylint
crash_pylint.py:1:0: F0001: Fatal error while checking 'crash_pylint.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/Users/name/Library/Caches/pylint/pylint-crash-2022-03-25-14.txt'. (fatal)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
Configuration
No response
Command used
pylint -d C0114,C0115,C0116 test.py
Pylint output
Exception on node <Name.SomeClass l.7 at 0x112389a10>in file '/private/tmp/pylintfail/crash_pylint.py'
Traceback (most recent call last):
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/utils/ast_walker.py", line 73, in walk
callback(astroid)
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 1362, in visit_name
self._undefined_and_used_before_checker(node, stmt)
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 1405, in _undefined_and_used_before_checker
node, stmt, frame, current_consumer, i, base_scope_type
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 1595, in _check_consumer
is_recursive_klass,
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 1866, in _is_variable_violation
maybe_before_assign = _detect_global_scope(node, frame, defframe)
File "/private/tmp/pylintfail/.venv/lib/python3.7/site-packages/pylint/checkers/variables.py", line 262, in _detect_global_scope
return frame.lineno < defframe.lineno
TypeError: '<' not supported between instances of 'int' and 'NoneType'************* Module crash_pylint
crash_pylint.py:1:0: F0001: Fatal error while checking 'crash_pylint.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in'/Users/name/Library/Caches/pylint/pylint-crash-2022-03-25-14.txt'. (fatal)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
Bug description
Steps to reproduce
test.py
with contents:Expected
pylint==2.12.2
and earlier versions of pylintActual
Configuration
No response
Command used
Pylint output
Expected behavior
pylint succeeds
Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: