Merge pull request #1531 from pre-commit/upgrade_mypy

upgrade mypy to get typeshed fixes
This commit is contained in:
Anthony Sottile 2020-07-08 14:22:23 -07:00 committed by GitHub
commit 2f1d4d10e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View file

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

View file

@ -21,13 +21,13 @@ if os.name == 'nt': # pragma: no cover (windows)
) -> Generator[None, None, None]:
try:
# 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:
blocked_cb()
while True:
try:
# 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:
# Locking violation. Returned when the _LK_LOCK or _LK_RLCK
# 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
# before closing a file or exiting the program."
# 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
import fcntl