Browse Source

px_uploader.py remove special pyserial checks that fail on some platforms

release/1.12
Daniel Agar 4 years ago committed by Julian Oes
parent
commit
61e972ba35
  1. 34
      Tools/px_uploader.py
  2. 2
      Tools/setup/requirements.txt

34
Tools/px_uploader.py

@ -56,7 +56,6 @@ from __future__ import print_function @@ -56,7 +56,6 @@ from __future__ import print_function
import sys
import argparse
import binascii
import serial
import socket
import struct
import json
@ -68,6 +67,16 @@ import os @@ -68,6 +67,16 @@ import os
from sys import platform as _platform
try:
import serial
except ImportError as e:
print("Failed to import serial: " + str(e))
print("")
print("You may need to install it using:")
print(" pip3 install --user pyserial")
print("")
sys.exit(1)
# Detect python version
if sys.version_info[0] < 3:
runningPython3 = False
@ -726,29 +735,6 @@ def main(): @@ -726,29 +735,6 @@ 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.
pyserial_installed = False
try:
if serial.__version__:
pyserial_installed = True
except:
pass
try:
if serial.VERSION:
pyserial_installed = True
except:
pass
if not pyserial_installed:
print("Error: pyserial not installed!")
print("")
print("You may need to install it using:")
print(" pip3 install --user pyserial")
print("")
sys.exit(1)
# Load the firmware file
fw = firmware(args.firmware)

2
Tools/setup/requirements.txt

@ -15,7 +15,7 @@ pygments @@ -15,7 +15,7 @@ pygments
wheel>=0.31.1
pymavlink
pyros-genmsg
pyserial>=3.0
pyserial
pyulog>=0.5.0
pyyaml
requests

Loading…
Cancel
Save