Merge pull request #8963 from symonk/mypy-pathlike-runtime-checkable-fix

typeshed `os.PathLike` is now `@runtime_checkable`, remove mypy ignore
This commit is contained in:
Bruno Oliveira 2021-07-31 10:27:58 -03:00 committed by GitHub
commit 0fd0e2a27c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -305,9 +305,7 @@ def _prepareconfig(
) -> "Config": ) -> "Config":
if args is None: if args is None:
args = sys.argv[1:] args = sys.argv[1:]
# TODO: Remove type-ignore after next mypy release. elif isinstance(args, os.PathLike):
# https://github.com/python/typeshed/commit/076983eec45e739c68551cb6119fd7d85fd4afa9
elif isinstance(args, os.PathLike): # type: ignore[misc]
args = [os.fspath(args)] args = [os.fspath(args)]
elif not isinstance(args, list): elif not isinstance(args, list):
msg = "`args` parameter expected to be a list of strings, got: {!r} (type: {})" msg = "`args` parameter expected to be a list of strings, got: {!r} (type: {})"