Skip to content

Commit 235fc1f

Browse files
authored
Add error handling when opening serial_log.txt
Wrap file opening in a try block for error handling.
1 parent e03e504 commit 235fc1f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

uc2rest/mserial.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ def _sending_commands(self):
308308
def _process_commands(self):
309309
# create file writer object so save all self._read to a txt
310310
f = None
311-
s f = open("serial_log.txt", "w", buffering=1) # Line buffering
311+
try:
312+
f = open("serial_log.txt", "w", buffering=1) # Line buffering
312313
f.write("Serial Log Start\n")
313314
f.flush()
314315
buffer = ""

0 commit comments

Comments
 (0)