Skip to content

Commit

Permalink
Bump mypy to 0.790 for Python 3.9 compat
Browse files Browse the repository at this point in the history
HashError.order is now annotated as an int to allow
HashErrors.errors.sort(key=lambda e: e.order).  Alternatively we can
define a function which assert e is not None but I prefer the more
concise version, since we never raise HashError directly anyway.
  • Loading branch information
McSinyx committed Oct 12, 2020
1 parent da7569a commit cf6ecab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ repos:
files: \.py$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.770
rev: v0.790
hooks:
- id: mypy
exclude: docs|tests
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class HashError(InstallationError):
"""
req = None # type: Optional[InstallRequirement]
head = ''
order = None # type: Optional[int]
order = -1 # type: int

def body(self):
# type: () -> str
Expand Down

0 comments on commit cf6ecab

Please sign in to comment.