Skip to main content
 首页 » 编程设计

python之Flake8Lint 错误 : AttributeError: 'NoneType' object has no attribute 'kind'

2024年10月01日9zfyouxi

今天启动 Sublime Text 3,发现 Flake8Lint 未激活。我检查了控制台并出现了这么长的错误:

Flake8Lint ERROR: Traceback (most recent call last): 
Flake8Lint ERROR: File "/Users/juliansmithdeniro/Library/Application Support/Sublime Text 3/Packages/Python Flake8 Lint/lint.py", line 405, in  
Flake8Lint ERROR: for lint_warning in lint(stdin_lines, lint_settings): 
Flake8Lint ERROR: File "/Users/juliansmithdeniro/Library/Application Support/Sublime Text 3/Packages/Python Flake8 Lint/lint.py", line 206, in lint 
Flake8Lint ERROR: for error in PEP257Checker().check_source(lines, ''): 
Flake8Lint ERROR: File "/Users/juliansmithdeniro/Library/Application Support/Sublime Text 3/Packages/Python Flake8 Lint/contrib/pydocstyle.py", line 1359, in check_source 
Flake8Lint ERROR: module = parse(StringIO(source), filename) 
Flake8Lint ERROR: File "/Users/juliansmithdeniro/Library/Application Support/Sublime Text 3/Packages/Python Flake8 Lint/contrib/pydocstyle.py", line 275, in __call__ 
Flake8Lint ERROR: return self.parse_module() 
Flake8Lint ERROR: File "/Users/juliansmithdeniro/Library/Application Support/Sublime Text 3/Packages/Python Flake8 Lint/contrib/pydocstyle.py", line 428, in parse_module 
Flake8Lint ERROR: children = list(self.parse_definitions(Module, all=True)) 
Flake8Lint ERROR: File "/Users/juliansmithdeniro/Library/Application Support/Sublime Text 3/Packages/Python Flake8 Lint/contrib/pydocstyle.py", line 366, in parse_definitions 
Flake8Lint ERROR: yield self.parse_definition(class_._nest(self.current.value)) 
Flake8Lint ERROR: File "/Users/juliansmithdeniro/Library/Application Support/Sublime Text 3/Packages/Python Flake8 Lint/contrib/pydocstyle.py", line 485, in parse_definition 
Flake8Lint ERROR: class_.__name__, name, self.current.kind, 
Flake8Lint ERROR: AttributeError: 'NoneType' object has no attribute 'kind' 

我尝试禁用并重新启用,然后卸载并重新安装。如果有人有一些知识可以传授,我们将不胜感激!

请您参考如下方法:

我明白了。刚刚更换

../Sublime Text 3/Packages/Python Flake8 Lint/contrib/pyflakes/checker.py

与: https://github.com/richardasaurus/Flake8Lint/blob/master/contrib/pyflakes/checker.py

感谢 GitHub 上发布的这个问题:https://github.com/dreadatour/Flake8Lint/issues/61