projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More mypy cleanup.
[python_utils.git]
/
ansi.py
diff --git
a/ansi.py
b/ansi.py
index 9e31b811ab978fa1ae81c3974ba991700287d867..6897291ba252f91c866b967cd18e0aa13f0f151d 100755
(executable)
--- a/
ansi.py
+++ b/
ansi.py
@@
-1890,19
+1890,19
@@
def bg(
class StdoutInterceptor(io.TextIOBase):
def __init__(self):
class StdoutInterceptor(io.TextIOBase):
def __init__(self):
- self.saved_stdout:
Optional[io.TextIOBase]
= None
+ self.saved_stdout:
io.TextIO
= None
self.buf = ''
@abstractmethod
def write(self, s: str):
pass
self.buf = ''
@abstractmethod
def write(self, s: str):
pass
- def __enter__(self)
-> None
:
+ def __enter__(self):
self.saved_stdout = sys.stdout
sys.stdout = self
self.saved_stdout = sys.stdout
sys.stdout = self
- return
None
+ return
self
- def __exit__(self, *args) ->
bool
:
+ def __exit__(self, *args) ->
Optional[bool]
:
sys.stdout = self.saved_stdout
print(self.buf)
return None
sys.stdout = self.saved_stdout
print(self.buf)
return None