path: root/scripts
diff options
authorDiana Picus <diana.picus@linaro.org>2017-04-05 19:48:39 +0200
committerDiana Picus <diana.picus@linaro.org>2017-04-06 11:06:27 +0200
commitb430760d782ac5a4e1270d49038d0f400a3506c0 (patch)
tree647ae28124b061b22e51cd7cb1de12e80fb2fe48 /scripts
parent3b2ef824adf41d86c5371b8c8db4f74bb7ac83c0 (diff)
Move to Python3
Most of the changes have been made by 2to3. Some manual fiddling was needed to make sure we're calling python3 instead of just python in the tests. Two of the helpers in the tests were reworked into proper methods rather than partials because we had to convert their returned value to str and this seems like the most straightforward/easy-to-read way. Change-Id: I74fdc1eaade3c026ee0c3e6bcdf26f8840f259b3
Diffstat (limited to 'scripts')
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/llvm.py b/scripts/llvm.py
index 762f9e7..706af11 100644
--- a/scripts/llvm.py
+++ b/scripts/llvm.py
@@ -12,7 +12,7 @@ from argparse import Action, ArgumentParser, RawTextHelpFormatter
def die(message, config_to_dump=None):
"""Print an error message and exit."""
- print message
+ print(message)
if config_to_dump is not None:
@@ -35,13 +35,13 @@ llvm_worktree_root = os.environ["LLVM_SRC"]
def dump_config(config):
"""Dump the list of projects that are enabled in the given config."""
- print "Projects linked:"
+ print("Projects linked:")
enabled = config.get_enabled_subprojects()
if not enabled:
- print "none"
+ print("none")
for subproj in sorted(enabled):
- print " + {}".format(subproj)
+ print(" + {}".format(subproj))
def projects(args):
@@ -74,7 +74,7 @@ def projects(args):
# If we decide we want shorthands for the subprojects, we can append to this
# list
-valid_subprojects = LLVMSubproject.get_all_subprojects().keys()
+valid_subprojects = list(LLVMSubproject.get_all_subprojects().keys())
options = ArgumentParser(formatter_class=RawTextHelpFormatter)
subcommands = options.add_subparsers()