-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[pre-commit.ci] pre-commit autoupdate #12910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
from typing import Any | ||
from typing import AnyStr | ||
from typing import BinaryIO | ||
from typing import cast | ||
from typing import Final | ||
from typing import final | ||
from typing import Generator | ||
|
@@ -177,7 +178,8 @@ | |
def mode(self) -> str: | ||
# TextIOWrapper doesn't expose a mode, but at least some of our | ||
# tests check it. | ||
return self.buffer.mode.replace("b", "") | ||
assert hasattr(self.buffer, "mode") | ||
return cast(str, self.buffer.mode.replace("b", "")) | ||
|
||
|
||
class CaptureIO(io.TextIOWrapper): | ||
|
@@ -550,7 +552,7 @@ | |
res = self.tmpfile.buffer.read() | ||
self.tmpfile.seek(0) | ||
self.tmpfile.truncate() | ||
return res | ||
return res # type: ignore[return-value] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems it's a false positive, the return from read() is in fact There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like it can be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we fix something then (cast to str) ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pre-commit bot removed our changes, I force pushed them back :) |
||
|
||
def writeorg(self, data: bytes) -> None: | ||
"""Write to original file descriptor.""" | ||
|
Uh oh!
There was an error while loading. Please reload this page.