Skip to content
Snippets Groups Projects
Commit 7be05396 authored by Julian Oes's avatar Julian Oes
Browse files

px_uploader.py: check for pyserial

If we dont explicitly check for pyserial, we can have the case where the
import works but the Serial object creation fails. However, we don't see
this because we have this huge try/catch block which swallows
everything.
parent ed2d4f6a
No related branches found
No related tags found
No related merge requests found
......@@ -732,6 +732,16 @@ def main():
print("WARNING: You should uninstall ModemManager as it conflicts with any non-modem serial device (like Pixhawk)")
print("==========================================================================================================")
# We need to check for pyserial because the import itself doesn't
# seem to fail, at least not on macOS.
try:
if serial.__version__:
pass
except:
print("Error: pyserial not installed!")
print(" (Install using: sudo pip install pyserial)")
sys.exit(1)
# Load the firmware file
fw = firmware(args.firmware)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment