Skip to content

Return None from MbedTerminal Constructor #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions mbed/mbed_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@ def __init__(self, port, baudrate=9600, echo=True, timeout=10):

try:
from serial import Serial, SerialException
except (IOError, ImportError, OSError):
return False

try:
self.serial = Serial(self.port, baudrate=self.baudrate, timeout=self.timeout)
self.serial.flush()
self.serial.reset_input_buffer()
except Exception as e:
except (IOError, ImportError, OSError, Exception):
self.serial = None
return False
return

def terminal(self, print_header=True):
try:
Expand Down