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

Fix a crash in sys.version_info check #59

Merged
merged 2 commits into from
Jan 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
slight cleanup
  • Loading branch information
Akuli committed Jan 14, 2022
commit 16df12a9a439b12901ac01b2023c00b10c7b96f7
3 changes: 2 additions & 1 deletion pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ def _check_version_check(
if not isinstance(comparator, ast.Tuple):
self.error(node, Y003)
return
elif not all(isinstance(elt, ast.Num) for elt in comparator.elts):

if not all(isinstance(elt, ast.Num) for elt in comparator.elts):
self.error(node, Y003)
elif len(comparator.elts) > 2:
# mypy only supports major and minor version checks
Expand Down