mirror of
https://github.com/hexchat/hexchat.git
synced 2024-11-05 02:32:31 +01:00
python: add flush() to Stdout
Python sometime calls flush() on sys.stdout or sys.stderr. In particular, it might do so when an exception is raised. This fixes the second error message that was generated in such cases. Signed-off-by: Celelibi <celelibi@gmail.com>
This commit is contained in:
parent
c48afe3799
commit
847e5a14d6
@ -64,6 +64,10 @@ class Stdout:
|
||||
else:
|
||||
self.buffer += string
|
||||
|
||||
def flush(self):
|
||||
lib.hexchat_print(lib.ph, bytes(self.buffer))
|
||||
self.buffer = bytearray()
|
||||
|
||||
def isatty(self):
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user