1

我已经创建了许多测试,并且在本地和 gihub CI 上都可以正常工作,但是在检查 PyLint 时我收到了这个错误RecursionError: maximum recursion depth exceeded in comparison

如果你能帮助我,我会很棒。

在服务器上运行的命令:

DJANGO_SETTINGS_MODULE=projectname.settings.test_set pylint --generated-members=viridis --load-plugins pylint_django project/apps/* --errors-only

错误

  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/astroid/decorators.py", line 89, in wrapped
    if context.push(node):
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/astroid/context.py", line 89, in push
    if (node, name) in self.path:
RecursionError: maximum recursion depth exceeded in comparison
"""
4

1 回答 1

1

此错误已在此 PR 中修复:https ://github.com/PyCQA/astroid/pull/733

确保您使用的是在此修复后发布的版本,或者尝试将 astroid 降级到版本 2.2.5

于 2020-12-23T22:15:39.527 回答