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:
Julian Oes
2020-01-16 16:25:26 +01:00
parent e98fa891fe
commit b04f68553e
7 changed files with 63 additions and 36 deletions
+7 -5
View File
@@ -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