[pre-commit.ci] pre-commit autoupdate (#11510)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.6.0) * Ignore two typing errors after updating to mypy 1.6.0 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
This commit is contained in:
parent
cac1eed0ea
commit
40e9abd66b
|
@ -56,7 +56,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: python-use-type-annotations
|
- id: python-use-type-annotations
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: v1.5.1
|
rev: v1.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
files: ^(src/|testing/)
|
files: ^(src/|testing/)
|
||||||
|
|
|
@ -755,7 +755,13 @@ class LocalPath:
|
||||||
if ensure:
|
if ensure:
|
||||||
self.dirpath().ensure(dir=1)
|
self.dirpath().ensure(dir=1)
|
||||||
if encoding:
|
if encoding:
|
||||||
return error.checked_call(io.open, self.strpath, mode, encoding=encoding)
|
# Using type ignore here because of this error:
|
||||||
|
# error: Argument 1 has incompatible type overloaded function;
|
||||||
|
# expected "Callable[[str, Any, Any], TextIOWrapper]" [arg-type]
|
||||||
|
# Which seems incorrect, given io.open supports the given argument types.
|
||||||
|
return error.checked_call(
|
||||||
|
io.open, self.strpath, mode, encoding=encoding # type:ignore[arg-type]
|
||||||
|
)
|
||||||
return error.checked_call(open, self.strpath, mode)
|
return error.checked_call(open, self.strpath, mode)
|
||||||
|
|
||||||
def _fastjoin(self, name):
|
def _fastjoin(self, name):
|
||||||
|
@ -1261,13 +1267,19 @@ class LocalPath:
|
||||||
@classmethod
|
@classmethod
|
||||||
def mkdtemp(cls, rootdir=None):
|
def mkdtemp(cls, rootdir=None):
|
||||||
"""Return a Path object pointing to a fresh new temporary directory
|
"""Return a Path object pointing to a fresh new temporary directory
|
||||||
(which we created ourself).
|
(which we created ourselves).
|
||||||
"""
|
"""
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
if rootdir is None:
|
if rootdir is None:
|
||||||
rootdir = cls.get_temproot()
|
rootdir = cls.get_temproot()
|
||||||
return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir)))
|
# Using type ignore here because of this error:
|
||||||
|
# error: Argument 1 has incompatible type overloaded function; expected "Callable[[str], str]" [arg-type]
|
||||||
|
# Which seems incorrect, given tempfile.mkdtemp supports the given argument types.
|
||||||
|
path = error.checked_call(
|
||||||
|
tempfile.mkdtemp, dir=str(rootdir) # type:ignore[arg-type]
|
||||||
|
)
|
||||||
|
return cls(path)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def make_numbered_dir(
|
def make_numbered_dir(
|
||||||
|
|
Loading…
Reference in New Issue