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

New mypy error with asyncio.Task #1511

Closed
alexrudd2 opened this issue Apr 24, 2023 · 0 comments · Fixed by #1512
Closed

New mypy error with asyncio.Task #1511

alexrudd2 opened this issue Apr 24, 2023 · 0 comments · Fixed by #1512

Comments

@alexrudd2
Copy link
Collaborator

❯ git checkout 67d875b785d4f79da7b76413ae62ad71a1259fc3
Note: switching to '67d875b785d4f79da7b76413ae62ad71a1259fc3'.
❯ python3.11 -m mypy pymodbus
Success: no issues found in 58 source files
❯ git checkout dev
Previous HEAD position was 67d875b7 Solve serial close raise problem.
Switched to branch 'dev'
Your branch is up to date with 'upstream/dev'.

❯ python3.11 -m mypy pymodbus
pymodbus/client/base.py:267: error: Statement is unreachable  [unreachable]
pymodbus/client/base.py:274: error: Incompatible types in assignment (expression has type "Task[Any]", variable has type "None")  [assignment]
Found 2 errors in 1 file (checked 60 source files)

❯ python3.8 -m mypy pymodbus
Success: no issues found in 60 source files

It appears that Python3.11 mypy catches this, but Python3.8 does not (which is why the CI didn't flag it). My guess is that asyncio has improved its type definitions. Anyways, it's an easy fix with a hint; I'll prepare a PR.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant