mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 23:23:33 +08:00
Tools: use Python 3, improve import checks
In more detail: - Change shebang to Python 3. - Suggest installation using pip3 as user.
This commit is contained in:
+12
-8
@@ -9,19 +9,23 @@ import sys
|
||||
|
||||
try:
|
||||
import yaml
|
||||
except:
|
||||
print("Failed to import yaml.")
|
||||
print("You may need to install it with 'sudo pip install pyyaml'")
|
||||
except ImportError as e:
|
||||
print("Failed to import yaml: " + e)
|
||||
print("")
|
||||
raise
|
||||
print("You may need to install it using:")
|
||||
print(" pip3 install --user pyyaml")
|
||||
print("")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import cerberus
|
||||
except:
|
||||
print("Failed to import cerberus.")
|
||||
print("You may need to install it with 'sudo pip install cerberus'")
|
||||
except ImportError as e:
|
||||
print("Failed to import cerberus: " + e)
|
||||
print("")
|
||||
raise
|
||||
print("You may need to install it using:")
|
||||
print(" pip3 install --user cerberus")
|
||||
print("")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description='Validate YAML file(s) against a schema')
|
||||
|
||||
Reference in New Issue
Block a user