mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 08:48:53 +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:
@@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
""" Script to generate Serial (UART) parameters and the ROMFS startup script """
|
||||
|
||||
from __future__ import print_function
|
||||
@@ -11,11 +11,13 @@ from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
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)
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
Reference in New Issue
Block a user