Skip to content

Commit 13ffe99

Browse files
Merge pull request #765 from theotherjimmy/return-none
Return None from MbedTerminal Constructor
2 parents 2e0dc6a + 7aa357a commit 13ffe99

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mbed/mbed_terminal.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,12 @@ def __init__(self, port, baudrate=9600, echo=True, timeout=10):
3434

3535
try:
3636
from serial import Serial, SerialException
37-
except (IOError, ImportError, OSError):
38-
return False
39-
40-
try:
4137
self.serial = Serial(self.port, baudrate=self.baudrate, timeout=self.timeout)
4238
self.serial.flush()
4339
self.serial.reset_input_buffer()
44-
except Exception as e:
40+
except (IOError, ImportError, OSError, Exception):
4541
self.serial = None
46-
return False
42+
return
4743

4844
def terminal(self, print_header=True):
4945
try:

0 commit comments

Comments
 (0)