vscode debug AttributeError: 'NoneType' object has no attribute 'flush' or 'fileno'

This commit is contained in:
lededev
2022-02-26 15:37:05 +08:00
parent a3c8398f29
commit c354518c57

View File

@@ -113,9 +113,12 @@ class OutLogger(object):
self.log.write(msg) self.log.write(msg)
def flush(self): def flush(self):
self.term.flush() if 'flush' in dir(self.term):
self.log.flush() self.term.flush()
os.fsync(self.log.fileno()) if 'flush' in dir(self.log):
self.log.flush()
if 'fileno' in dir(self.log):
os.fsync(self.log.fileno())
def close(self): def close(self):
if self.term is not None: if self.term is not None: