mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00: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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user