mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-06-24 19:25:32 +02:00
Solved EOL bug
This commit is contained in:
parent
7dd8fd4a5f
commit
0114b30824
15
main.py
15
main.py
@ -162,12 +162,17 @@ if __name__ == "__main__":
|
||||
text=True
|
||||
)
|
||||
os.close(slave_fd)
|
||||
import errno
|
||||
with os.fdopen(master_fd) as master:
|
||||
for line in master:
|
||||
ts = datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
|
||||
log_file.write(f"{ts} {line}")
|
||||
log_file.flush()
|
||||
print(line, end='')
|
||||
try:
|
||||
for line in master:
|
||||
ts = datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
|
||||
log_file.write(f"{ts} {line}")
|
||||
log_file.flush()
|
||||
print(line, end='')
|
||||
except OSError as e:
|
||||
if e.errno != errno.EIO:
|
||||
raise
|
||||
proc.wait()
|
||||
rc = proc.returncode
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user