Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Plain typing.NoReturn is not valid as type argument in Astroid 2.8.5 + Python 3.7.0/1 #1239

Closed
drasmuss opened this issue Nov 12, 2021 · 2 comments · Fixed by #1235 or #1252
Labels
Milestone

Comments

@drasmuss
Copy link

drasmuss commented Nov 12, 2021

Steps to reproduce

  1. Use Python 3.7.0 or 3.7.1
  2. pip install astroid==2.8.5
  3. python -c "import astroid"

Current behavior

An error is raised

TypeError: Plain typing.NoReturn is not valid as type argument

In this commit b62f243#diff-039e09546480e9ce70fc9a23e975f1ac2364f6d0192e330311d204653947a216R34 there is a conditional import that checks if Python >= 3.6.2, but that should also include Python 3.7.0 and 3.7.1 (which have the same issue as Python 3.6.0/1).

Expected behavior

There should be no error

python -c "from astroid import pkginfo; print(pkginfo.version)" output

This raises the same error as above

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.8.6 milestone Nov 12, 2021
@DanielNoord
Copy link
Collaborator

This seems to be caused by https://bugs.python.org/issue34921

Perhaps we also need to update the import guards in pylint?

@Pierre-Sassoulas
Copy link
Member

I was in the process of adding flake8-typing-import to the pre-commit hooks but it seems it's not yet detected.

Pierre-Sassoulas added a commit that referenced this issue Nov 21, 2021
Relates to #1239

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
tushar-deepsource pushed a commit to tushar-deepsource/astroid that referenced this issue Dec 20, 2021
…1240)

Relates to pylint-dev#1239

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants