upgrade mypy to get typeshed fixes

This commit is contained in:
Anthony Sottile 2020-07-08 13:55:28 -07:00
parent 6fe1702ee1
commit c9ad2e1451
2 changed files with 10 additions and 10 deletions

View file

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0 rev: v3.1.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
@ -12,20 +12,20 @@ repos:
- id: requirements-txt-fixer - id: requirements-txt-fixer
- id: double-quote-string-fixer - id: double-quote-string-fixer
- repo: https://gitlab.com/pycqa/flake8 - repo: https://gitlab.com/pycqa/flake8
rev: 3.8.0 rev: 3.8.3
hooks: hooks:
- id: flake8 - id: flake8
additional_dependencies: [flake8-typing-imports==1.6.0] additional_dependencies: [flake8-typing-imports==1.6.0]
- repo: https://github.com/pre-commit/mirrors-autopep8 - repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.5.2 rev: v1.5.3
hooks: hooks:
- id: autopep8 - id: autopep8
- repo: https://github.com/pre-commit/pre-commit - repo: https://github.com/pre-commit/pre-commit
rev: v2.4.0 rev: v2.6.0
hooks: hooks:
- id: validate_manifest - id: validate_manifest
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.4.1 rev: v2.6.2
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py36-plus] args: [--py36-plus]
@ -40,11 +40,11 @@ repos:
- id: add-trailing-comma - id: add-trailing-comma
args: [--py36-plus] args: [--py36-plus]
- repo: https://github.com/asottile/setup-cfg-fmt - repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.9.0 rev: v1.10.0
hooks: hooks:
- id: setup-cfg-fmt - id: setup-cfg-fmt
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.770 rev: v0.782
hooks: hooks:
- id: mypy - id: mypy
exclude: ^testing/resources/ exclude: ^testing/resources/

View file

@ -21,13 +21,13 @@ if os.name == 'nt': # pragma: no cover (windows)
) -> Generator[None, None, None]: ) -> Generator[None, None, None]:
try: try:
# TODO: https://github.com/python/typeshed/pull/3607 # TODO: https://github.com/python/typeshed/pull/3607
msvcrt.locking(fileno, msvcrt.LK_NBLCK, _region) # type: ignore msvcrt.locking(fileno, msvcrt.LK_NBLCK, _region)
except OSError: except OSError:
blocked_cb() blocked_cb()
while True: while True:
try: try:
# TODO: https://github.com/python/typeshed/pull/3607 # TODO: https://github.com/python/typeshed/pull/3607
msvcrt.locking(fileno, msvcrt.LK_LOCK, _region) # type: ignore # noqa: E501 msvcrt.locking(fileno, msvcrt.LK_LOCK, _region)
except OSError as e: except OSError as e:
# Locking violation. Returned when the _LK_LOCK or _LK_RLCK # Locking violation. Returned when the _LK_LOCK or _LK_RLCK
# flag is specified and the file cannot be locked after 10 # flag is specified and the file cannot be locked after 10
@ -46,7 +46,7 @@ if os.name == 'nt': # pragma: no cover (windows)
# "Regions should be locked only briefly and should be unlocked # "Regions should be locked only briefly and should be unlocked
# before closing a file or exiting the program." # before closing a file or exiting the program."
# TODO: https://github.com/python/typeshed/pull/3607 # TODO: https://github.com/python/typeshed/pull/3607
msvcrt.locking(fileno, msvcrt.LK_UNLCK, _region) # type: ignore msvcrt.locking(fileno, msvcrt.LK_UNLCK, _region)
else: # pragma: win32 no cover else: # pragma: win32 no cover
import fcntl import fcntl