python2 --> python3

Update all scripts and build system to call python3, given python2's
upcoming doom. Use sys.maxsize instead of sys.maxint in one script
(maxint does not exist in python3).
This commit is contained in:
Anna Lyons
2019-06-25 14:08:28 +10:00
committed by Edward Pierzchalski
parent 9dc013a034
commit bc61a7f3bd
18 changed files with 21 additions and 20 deletions

View File

@@ -33,6 +33,7 @@ include(tools/internal.cmake)
# Define tools used by the kernel
set(PYTHON "python" CACHE INTERNAL "")
set(PYTHON3 "python3" CACHE INTERNAL "")
RequireTool(CPP_GEN_PATH cpp_gen.sh)
RequireTool(CIRCULAR_INCLUDES circular_includes.py)
RequireTool(BF_GEN_PATH bitfield_gen.py)
@@ -319,7 +320,7 @@ add_custom_command(
COMMAND
${CMAKE_COMMAND} -E remove -f "${syscall_dest}"
COMMAND
${PYTHON} "${SYSCALL_ID_GEN_PATH}"
${PYTHON3} "${SYSCALL_ID_GEN_PATH}"
--xml "${syscall_xml_base}/syscall.xml"
--kernel_header "${syscall_dest}"
DEPENDS

View File

@@ -160,7 +160,7 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL ""))
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gen_headers/plat/machine/")
execute_process(
COMMAND
${PYTHON} "${HARDWARE_GEN_PATH}" --dtb "${KernelDTBPath}" --compatibility-strings
${PYTHON3} "${HARDWARE_GEN_PATH}" --dtb "${KernelDTBPath}" --compatibility-strings
"${compatibility_outfile}" --output "${device_dest}" --config "${config_file}"
--schema "${config_schema}" --yaml "${platform_yaml}" --arch "${KernelArch}"
INPUT_FILE /dev/stdin

View File

@@ -126,7 +126,7 @@ add_custom_command(
"${CMAKE_CURRENT_SOURCE_DIR}/include/api/syscall.xsd"
"${CMAKE_CURRENT_SOURCE_DIR}/include/api/syscall.xml"
COMMAND
${PYTHON} "${SYSCALL_ID_GEN_PATH}"
${PYTHON3} "${SYSCALL_ID_GEN_PATH}"
--xml "${CMAKE_CURRENT_SOURCE_DIR}/include/api/syscall.xml"
--libsel4_header include/sel4/syscall.h
DEPENDS
@@ -148,7 +148,7 @@ add_custom_command(
COMMAND
echo "CONFIG_WORD_SIZE=${KernelWordSize}" > config
COMMAND
"${PYTHON}" "${SYSCALL_STUB_GEN_PATH}" ${buffer} -a "${KernelSel4Arch}" -c config -o
"${PYTHON3}" "${SYSCALL_STUB_GEN_PATH}" ${buffer} -a "${KernelSel4Arch}" -c config -o
include/interfaces/sel4_client.h ${interface_xmls}
DEPENDS
"${SYSCALL_STUB_GEN_PATH}"

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -40,7 +40,7 @@ mv = mv
awk = awk
R = R
doxygen = doxygen
PYTHON ?= python
PYTHON ?= python3
# To add a second target, simply append the basename of the .tex file here
Targets = manual

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
@@ -417,7 +417,7 @@ class MarkdownGenerator(Generator):
def generate_enumerate_list(self, para, ref_dict, output):
""" Returns a Markdown number list """
for num, item in zip(xrange(sys.maxint), para.contents):
for num, item in zip(range(sys.maxsize), para.contents):
parsed_item = self.parse_para(item, ref_dict)
output += "%d. %s" % (num, parsed_item) if parsed_item.rstrip() else ""
return output

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2018, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -117,7 +117,7 @@ function(GenBFCommand args target_name pbf_path pbf_target deps)
add_custom_command(
OUTPUT "${target_name_absolute}"
COMMAND
"${PYTHON}" "${BF_GEN_PATH}" "${args}" "${pbf_path_absolute}" "${target_name_absolute}"
"${PYTHON3}" "${BF_GEN_PATH}" "${args}" "${pbf_path_absolute}" "${target_name_absolute}"
DEPENDS
"${BF_GEN_PATH}"
"${pbf_path_absolute}"

View File

@@ -44,7 +44,7 @@ function(gen_invocation_header)
OUTPUT "${GEN_OUTPUT}"
COMMAND rm -f "${GEN_OUTPUT}"
COMMAND
"${PYTHON}" "${INVOCATION_ID_GEN_PATH}"
"${PYTHON3}" "${INVOCATION_ID_GEN_PATH}"
--xml "${xml_absolute}" ${libsel4_setting} ${arch_setting}
--dest "${GEN_OUTPUT}"
DEPENDS "${xml_absolute}" "${INVOCATION_ID_GEN_PATH}"

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017, Data61