mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 07:33:34 +08:00
More fixes for Python 3 compatibility (#13008)
* More fixes for Python 3 compatibility * Workaround if the six module is not pip installed * Lose the semicolons
This commit is contained in:
committed by
Julian Oes
parent
2a848c365c
commit
6dc55f97d4
@@ -53,6 +53,13 @@ try:
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"Failed to import yaml. You may need to install it with 'sudo pip install pyyaml'")
|
||||
try:
|
||||
from six.moves import input
|
||||
except ImportError:
|
||||
try:
|
||||
input = raw_input # Python 2
|
||||
except NameError:
|
||||
pass # Python 3
|
||||
|
||||
|
||||
def check_rtps_id_uniqueness(classifier):
|
||||
@@ -281,9 +288,9 @@ if agent == False and client == False:
|
||||
|
||||
if del_tree:
|
||||
if agent:
|
||||
_continue = str(raw_input("\nFiles in " + agent_out_dir +
|
||||
" will be erased, continue?[Y/n]\n"))
|
||||
if _continue == "N" or _continue == "n":
|
||||
_continue = str(input("\nFiles in " + agent_out_dir +
|
||||
" will be erased, continue?[Y/n]\n"))
|
||||
if _continue.strip() in ("N", "n"):
|
||||
print("Aborting execution...")
|
||||
exit(-1)
|
||||
else:
|
||||
@@ -291,9 +298,9 @@ if del_tree:
|
||||
shutil.rmtree(agent_out_dir)
|
||||
|
||||
if client:
|
||||
_continue = str(raw_input(
|
||||
_continue = str(input(
|
||||
"\nFiles in " + client_out_dir + " will be erased, continue?[Y/n]\n"))
|
||||
if _continue == "N" or _continue == "n":
|
||||
if _continue.strip() in ("N", "n"):
|
||||
print("Aborting execution...")
|
||||
exit(-1)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user