forked from Archive/PX4-Autopilot
px_uploader.py remove special pyserial checks that fail on some platforms
This commit is contained in:
parent
518222bae4
commit
61e972ba35
|
@ -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
|
|||
|
||||
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():
|
|||
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)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ pygments
|
|||
wheel>=0.31.1
|
||||
pymavlink
|
||||
pyros-genmsg
|
||||
pyserial>=3.0
|
||||
pyserial
|
||||
pyulog>=0.5.0
|
||||
pyyaml
|
||||
requests
|
||||
|
|
Loading…
Reference in New Issue