forked from platformio/platformio-core
Fix PyLint: Consider explicitly re-raising
This commit is contained in:
1 parent
f01cd7570c
commit
19d518fc4c
45 files changed
+136
-138
No files matched your search
@@ -137,9 +137,9 @@ def new_serial_instance(options): # pylint: disable=too-many-branches
|
||||
if port is None or port == "-":
|
||||
try:
|
||||
port = miniterm.ask_for_port()
|
||||
except KeyboardInterrupt:
|
||||
except KeyboardInterrupt as exc:
|
||||
click.echo("", err=True)
|
||||
raise UserSideException("User aborted and port is not given")
|
||||
raise UserSideException("User aborted and port is not given") from exc
|
||||
else:
|
||||
if not port:
|
||||
raise UserSideException("Port is not given")
|
||||
@@ -180,6 +180,6 @@ def new_serial_instance(options): # pylint: disable=too-many-branches
|
||||
|
||||
serial_instance.open()
|
||||
except serial.SerialException as exc:
|
||||
raise UserSideException(exc)
|
||||
raise UserSideException(exc) from exc
|
||||
|
||||
return serial_instance
|
||||
Reference in new issue
Block a user