From 8ba70f2a84b011eacaf975306409f3e7f2e60682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Sch=C3=BCtt?= Date: Sat, 23 May 2020 21:08:07 +0200 Subject: [PATCH] Move to Python3 --- .pre-commit-config.yaml | 9 --- tools/benchmark_plots/plot_benchmark.py | 5 +- tools/benchmark_plots/plot_comparison.py | 5 +- tools/build_utils/check_archives.py | 3 +- tools/build_utils/discover_programs.py | 3 +- tools/build_utils/fypp | 2 +- tools/build_utils/makedep.py | 3 +- tools/conventions/analyze_gfortran_ast.py | 5 +- .../conventions/analyze_gfortran_warnings.py | 5 +- tools/conventions/analyze_src.py | 28 ++++---- tools/conventions/summarize_issues.py | 4 +- tools/coverage/test_coverage.py | 7 +- tools/dashboard/generate_dashboard.py | 3 +- tools/dashboard/generate_regtest_survey.py | 3 +- tools/diff_cp2k.py | 4 +- tools/docker/scripts/install_python.sh | 6 -- tools/docker/scripts/test_python.sh | 9 +-- tools/doxify/is_fypp.py | 2 +- tools/find_bitrot_code.py | 64 ------------------- tools/find_openmp_mistakes.py | 59 ----------------- tools/fix_unused_public.py | 3 +- tools/logo/gen_cp2k_logo.py | 3 +- tools/manual/generate_sitemap.py | 3 +- tools/maple2f90/maple2f90.py | 2 +- .../minimax_to_fortran_source.py | 2 +- tools/package_planner/plan_packages.py | 40 ++++++------ tools/plot_mem_from_trace.py | 45 ------------- tools/regtesting/check_inputs.py | 2 +- tools/regtesting/prettify_TEST_FILES.py | 3 +- tools/regtesting/test_scaling.py | 3 +- tools/regtesting/timings.py | 4 +- tools/toolchain/scripts/parse_if.py | 3 +- 32 files changed, 62 insertions(+), 280 deletions(-) mode change 100644 => 100755 tools/benchmark_plots/plot_benchmark.py mode change 100644 => 100755 tools/benchmark_plots/plot_comparison.py delete mode 100755 tools/find_bitrot_code.py delete mode 100755 tools/find_openmp_mistakes.py delete mode 100755 tools/plot_mem_from_trace.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5adb40bbca..f1a675bead 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,15 +7,6 @@ repos: - id: check-yaml - id: check-added-large-files - id: check-ast - - id: check-ast - name: Check python ast (with Python 2.7) - language_version: python2.7 - stages: [manual] - files: '^tools/build_utils/.*\.py' - - id: check-ast - name: Check python ast (with Python 3) - language_version: python3 - stages: [manual] - repo: https://github.com/ambv/black rev: stable hooks: diff --git a/tools/benchmark_plots/plot_benchmark.py b/tools/benchmark_plots/plot_benchmark.py old mode 100644 new mode 100755 index a43acf1578..8bee0bab0a --- a/tools/benchmark_plots/plot_benchmark.py +++ b/tools/benchmark_plots/plot_benchmark.py @@ -1,8 +1,9 @@ +#!/usr/bin/env python3 + + """ Make a plot of CP2K benchmark data. """ -from __future__ import absolute_import -from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker diff --git a/tools/benchmark_plots/plot_comparison.py b/tools/benchmark_plots/plot_comparison.py old mode 100644 new mode 100755 index 87a07c904a..bbefaca34e --- a/tools/benchmark_plots/plot_comparison.py +++ b/tools/benchmark_plots/plot_comparison.py @@ -1,8 +1,9 @@ +#!/usr/bin/env python3 + + """ Make a plot of CP2K benchmark data. """ -from __future__ import absolute_import -from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker diff --git a/tools/build_utils/check_archives.py b/tools/build_utils/check_archives.py index 528724a828..641af690e9 100755 --- a/tools/build_utils/check_archives.py +++ b/tools/build_utils/check_archives.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett diff --git a/tools/build_utils/discover_programs.py b/tools/build_utils/discover_programs.py index 1cacad56dd..c836e1e4e8 100755 --- a/tools/build_utils/discover_programs.py +++ b/tools/build_utils/discover_programs.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 import re, sys, os from os import path diff --git a/tools/build_utils/fypp b/tools/build_utils/fypp index a2c7965572..cd672369d5 100755 --- a/tools/build_utils/fypp +++ b/tools/build_utils/fypp @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ################################################################################ # diff --git a/tools/build_utils/makedep.py b/tools/build_utils/makedep.py index a8e07c028b..8c008c5af4 100755 --- a/tools/build_utils/makedep.py +++ b/tools/build_utils/makedep.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 import re import sys diff --git a/tools/conventions/analyze_gfortran_ast.py b/tools/conventions/analyze_gfortran_ast.py index 82aa7ddd33..23b45fe7a9 100755 --- a/tools/conventions/analyze_gfortran_ast.py +++ b/tools/conventions/analyze_gfortran_ast.py @@ -1,10 +1,7 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett -from __future__ import print_function - import argparse import re from os import path diff --git a/tools/conventions/analyze_gfortran_warnings.py b/tools/conventions/analyze_gfortran_warnings.py index 56c3b279f2..a75cc66fc0 100755 --- a/tools/conventions/analyze_gfortran_warnings.py +++ b/tools/conventions/analyze_gfortran_warnings.py @@ -1,10 +1,7 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett -from __future__ import print_function - import argparse import re import ast diff --git a/tools/conventions/analyze_src.py b/tools/conventions/analyze_src.py index 6358335ad2..37e31f5557 100755 --- a/tools/conventions/analyze_src.py +++ b/tools/conventions/analyze_src.py @@ -1,10 +1,7 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett -from __future__ import print_function - import argparse import re import sys @@ -187,19 +184,20 @@ def validate(cp2k_dir, filelist=None, excluded_dirs=DEFAULT_EXCLUDED_DIRS): warnings += ["Text file %s contains DOS linebreaks" % shortfn] # check for non-ascii chars - if b"# -*- coding: utf-8 -*-" in content: - continue + if re.search(b"[\x80-\xFF]", content): + if absfn.endswith(".py"): + continue # python files are utf8 encoded by default - if not re.search(b"[\x80-\xFF]", content): - continue + if b"# -*- coding: utf-8 -*-" in content: + continue - for lineno, line in enumerate(content.splitlines()): - m = re.search(b"[\x80-\xFF]", line) - if m: - warnings += [ - "Found non-ascii char in %s line %d at position %d" - % (shortfn, lineno + 1, m.start(0) + 1) - ] + for lineno, line in enumerate(content.splitlines()): + m = re.search(b"[\x80-\xFF]", line) + if m: + warnings += [ + "Found non-ascii char in %s line %d at position %d" + % (shortfn, lineno + 1, m.start(0) + 1) + ] return warnings diff --git a/tools/conventions/summarize_issues.py b/tools/conventions/summarize_issues.py index 2fad035c1c..3e628a6fa3 100755 --- a/tools/conventions/summarize_issues.py +++ b/tools/conventions/summarize_issues.py @@ -1,9 +1,7 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett -from __future__ import print_function import argparse diff --git a/tools/coverage/test_coverage.py b/tools/coverage/test_coverage.py index 73e35f963b..ebdc23e8fd 100755 --- a/tools/coverage/test_coverage.py +++ b/tools/coverage/test_coverage.py @@ -1,9 +1,6 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# author: Ole Schuett +#!/usr/bin/env python3 -from __future__ import print_function +# author: Ole Schuett import sys import subprocess diff --git a/tools/dashboard/generate_dashboard.py b/tools/dashboard/generate_dashboard.py index 5843943fb2..b994e86b7f 100755 --- a/tools/dashboard/generate_dashboard.py +++ b/tools/dashboard/generate_dashboard.py @@ -1,5 +1,4 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # Generates the CP2K Dashboard html page # Inspired by Iain's cp2k_page_update.sh diff --git a/tools/dashboard/generate_regtest_survey.py b/tools/dashboard/generate_regtest_survey.py index d20d7fed46..ad5496ef4d 100755 --- a/tools/dashboard/generate_regtest_survey.py +++ b/tools/dashboard/generate_regtest_survey.py @@ -1,5 +1,4 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett diff --git a/tools/diff_cp2k.py b/tools/diff_cp2k.py index 11d8d16e59..57f8f4b68e 100755 --- a/tools/diff_cp2k.py +++ b/tools/diff_cp2k.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Compare CP2K outputs # Author: Alfio Lazzaro @@ -160,7 +160,7 @@ def main(): metavar="field", type=int, dest="field", - choices=xrange(1, 5), + choices=range(1, 5), default=2, help="which field to show (default is 2)", ) diff --git a/tools/docker/scripts/install_python.sh b/tools/docker/scripts/install_python.sh index 9913bb8e54..39175a1770 100755 --- a/tools/docker/scripts/install_python.sh +++ b/tools/docker/scripts/install_python.sh @@ -7,21 +7,15 @@ apt-get update -qq apt-get install -qq --no-install-recommends \ python \ python3 \ - libpython-stdlib \ libpython3-stdlib \ - python-pip \ python3-pip \ - python-wheel \ python3-wheel \ - python-setuptools \ python3-setuptools \ - python-dev \ python3-dev \ build-essential rm -rf /var/lib/apt/lists/* # install python packages -pip install --quiet numpy matplotlib requests pip3 install --quiet numpy matplotlib requests pre-commit # register the pre-commit hooks diff --git a/tools/docker/scripts/test_python.sh b/tools/docker/scripts/test_python.sh index 926acbb5e0..eb262655bc 100755 --- a/tools/docker/scripts/test_python.sh +++ b/tools/docker/scripts/test_python.sh @@ -12,10 +12,6 @@ function run_tests { #find ./src/ ./tools/ -name "*.pyc" -exec rm {} \; for i in $SCRIPTS ; do set +e #disable error trapping - if [[ $(head -n1 "$i") =~ "python3" && "$PYTHON" != "python3" ]]; then - echo "Skipping $i - it's Python3 only." - continue - fi echo "Running $i" cd "$(dirname "$i")" SCRIPT=$(basename "$i") @@ -31,7 +27,7 @@ function run_tests { function run_pre_commit { set +e #disable error trapping if ! pre-commit run --all-files --hook-stage manual check-ast ; then - echo "Syntax check failed for either Python 2 or 3" + echo "Syntax check failed." ERRORS=$((ERRORS+1)) fi set -e #re-enable error trapping @@ -46,9 +42,6 @@ cd /workspace/cp2k ALL_TEST_SCRIPTS=$(find ./src/ ./tools/ -name "*_test.py" -executable) ESSENTIAL_TEST_SCRIPTS=$(find ./tools/build_utils -name "*_test.py" -executable) -# python 2.7 -run_tests python2.7 "${ALL_TEST_SCRIPTS}" - # python 3.x run_tests python3 "${ALL_TEST_SCRIPTS}" diff --git a/tools/doxify/is_fypp.py b/tools/doxify/is_fypp.py index 8b9a1eaa37..4c385b8485 100755 --- a/tools/doxify/is_fypp.py +++ b/tools/doxify/is_fypp.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys, re diff --git a/tools/find_bitrot_code.py b/tools/find_bitrot_code.py deleted file mode 100755 index b3f01e97b6..0000000000 --- a/tools/find_bitrot_code.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import sys -from os.path import basename - -threshold = 5 -total_matches = 0 - -# =============================================================================== -def main(): - if len(sys.argv) < 2: - print( - "Tool for finding large commented regions of code. Uses very simply heuristics." - ) - print("Usage: find_bitrot_code ... ") - sys.exit(1) - - files = sys.argv[1:] - for fn in files: - check(fn) - - print("Found %d spots in %d files." % (total_matches, len(files))) - - -# =============================================================================== -def check(fn): - f = open(fn) - all_lines = f.read().split("\n") - - counter = 0 - start = 0 - - def report(): - global total_matches - total_matches += 1 - print(" +" + ("-" * 87) + "+") - msg = "%s: line %d ... line %d" % (basename(fn), start + 1, lineno + 1) - print(" | " + msg.ljust(85) + " |") - print(" +" + ("-" * 87) + "+") - for i in range(start, lineno): - print(" | %4d " % (i) + all_lines[i].ljust(80) + " |") - print(" +" + ("-" * 87) + "+") - print("\n") - - for lineno, line in enumerate(all_lines): - s = line.strip().lower() - - if s.startswith("!>") or s.startswith("!$omp"): - if counter > threshold: - report() - counter = 0 - elif s.startswith("!"): - if counter == 0: - start = lineno - counter += 1 - elif len(s) > 0: - if counter > threshold: - report() - counter = 0 - - -# =============================================================================== -main() diff --git a/tools/find_openmp_mistakes.py b/tools/find_openmp_mistakes.py deleted file mode 100755 index 95206308e7..0000000000 --- a/tools/find_openmp_mistakes.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import sys -import re -from os.path import basename - -total_matches = 0 - -# =============================================================================== -def main(): - if len(sys.argv) < 2: - print("Tool for finding common mistakes with OMP pragmas.") - print("Hint: It expects DEFAULT(NONE) in the first line of a PARALLEL pragma.") - print("Usage: find_openmp_mistakes.py ... ") - sys.exit(1) - - files = sys.argv[1:] - for fn in files: - check(fn) - - print("Found %d spots in %d files." % (total_matches, len(files))) - - -# =============================================================================== -def check(fn): - global total_matches - - f = open(fn) - all_lines = f.read().split("\n") - - for lineno, line in enumerate(all_lines): - m = re.search("^\s*!(.*)OMP\s", line, re.IGNORECASE) - if m and m.group(1) != "$": - total_matches += 1 - print( - 'Found strange OMP stuff "%s" in %s:%d' - % (m.group(0), basename(fn), lineno + 1) - ) - - m = re.search("!\$OMP\s+CRITICAL\s*$", line, re.IGNORECASE) - if m: - total_matches += 1 - print("Found unnamed OMP CRITICAL in %s:%d" % (basename(fn), lineno + 1)) - - m = re.search("!\$OMP\s+PARALLEL\s+(.*)$", line, re.IGNORECASE) - if m: - m2 = re.search("default\s*\(none\)", m.group(1), re.IGNORECASE) - if not m2: - total_matches += 1 - print( - "Found OMP PARALLEL without DEFAULT(NONE) %s:%d" - % (basename(fn), lineno + 1) - ) - # print line - - -# =============================================================================== -main() diff --git a/tools/fix_unused_public.py b/tools/fix_unused_public.py index 1d9b1e9967..fbec77becc 100755 --- a/tools/fix_unused_public.py +++ b/tools/fix_unused_public.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett diff --git a/tools/logo/gen_cp2k_logo.py b/tools/logo/gen_cp2k_logo.py index 60a1a07c16..a19508ac62 100755 --- a/tools/logo/gen_cp2k_logo.py +++ b/tools/logo/gen_cp2k_logo.py @@ -1,5 +1,4 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # Generates the CP2K Logo # diff --git a/tools/manual/generate_sitemap.py b/tools/manual/generate_sitemap.py index 46ac8aad09..33d9233956 100755 --- a/tools/manual/generate_sitemap.py +++ b/tools/manual/generate_sitemap.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 import os import sys diff --git a/tools/maple2f90/maple2f90.py b/tools/maple2f90/maple2f90.py index 8b58cb7fc8..33779fcac1 100755 --- a/tools/maple2f90/maple2f90.py +++ b/tools/maple2f90/maple2f90.py @@ -1,4 +1,4 @@ -#!/bin/env python +#!/usr/bin/env python3 import re, sys """Script to help the conversion of maple generated fortran code to f90""" diff --git a/tools/minimax_tools/minimax_to_fortran_source.py b/tools/minimax_tools/minimax_to_fortran_source.py index c874b3a740..45d42d43e4 100755 --- a/tools/minimax_tools/minimax_to_fortran_source.py +++ b/tools/minimax_tools/minimax_to_fortran_source.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import re import sys diff --git a/tools/package_planner/plan_packages.py b/tools/package_planner/plan_packages.py index 08b326caf2..72b8f35b7e 100755 --- a/tools/package_planner/plan_packages.py +++ b/tools/package_planner/plan_packages.py @@ -1,10 +1,8 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# A tool to help planning CP2K packages, listing currently violated dependencies if any -# +#!/usr/bin/env python3 -from __future__ import print_function +# author: Ole Schuett + +# A tool to help planning CP2K packages, listing currently violated dependencies if any import re, sys, os from os import path @@ -52,7 +50,7 @@ def main(): mod2fn = dict() for fn in src_files: for m in parsed_files[fn]["module"]: - if mod2fn.has_key(m): + if m in mod2fn: error('Multiple declarations of module "%s"' % m) mod2fn[m] = fn print("Created mod2fn table, found %d modules." % len(mod2fn)) @@ -77,15 +75,15 @@ def main(): # update with manifest with planned packages for pp in planned_pkgs: p = abspath(path.join(srcdir, pp["dirname"])) - if not packages.has_key(p): + if p not in packages: packages[p] = {"problems": []} packages[p].update(pp) - if pp.has_key("files"): + if "files" in pp: for fn in pp["files"]: fn2pkg[fn] = p - if pp.has_key("requires+"): + if "requires+" in pp: packages[p]["requires"] += pp["requires+"] - if pp.has_key("requires-"): + if "requires-" in pp: for i in pp["requires-"]: while i in packages[p]["requires"]: packages[p]["requires"].remove(i) @@ -101,9 +99,7 @@ def main(): for fn in src_files: p = fn2pkg[basename(fn)] deps = collect_include_deps(parsed_files, fn) - deps += [ - mod2fn[m] for m in collect_use_deps(parsed_files, fn) if mod2fn.has_key(m) - ] + deps += [mod2fn[m] for m in collect_use_deps(parsed_files, fn) if m in mod2fn] n_deps += len(deps) for d in deps: dp = fn2pkg[basename(d)] @@ -114,7 +110,7 @@ def main(): ) if dp not in packages[p]["allowed_deps"]: packages[p]["problems"].append(msg + "(requirement not listed)") - if dp != p and packages[dp].has_key("public"): + if dp != p and "public" in packages[dp]: if basename(d) not in packages[dp]["public"]: packages[p]["problems"].append(msg + "(file not public)") @@ -170,7 +166,7 @@ def parse_file(parsed_files, fn): # ============================================================================= def read_manifest(packages, p): - if packages.has_key(p): + if p in packages: return fn = p + "/PACKAGE" @@ -188,7 +184,7 @@ def read_manifest(packages, p): # ============================================================================= def process_manifest(packages, p): - if not packages[p].has_key("archive"): + if "archive" not in packages[p]: packages[p]["archive"] = "libcp2k" + basename(p) packages[p]["allowed_deps"] = [normpath(p)] packages[p]["allowed_deps"] += [ @@ -197,7 +193,7 @@ def process_manifest(packages, p): for r in packages[p]["requires"]: rp = normpath(path.join(p, r)) - if not packages.has_key(rp): + if rp not in packages: error( "Unexpected package requirement: " + r @@ -224,7 +220,7 @@ def collect_include_deps(parsed_files, fn): for i in pf["include"]: fn_inc = normpath(path.join(dirname(fn), i)) - if parsed_files.has_key(fn_inc): + if fn_inc in parsed_files: incs.append(fn_inc) incs += collect_include_deps(parsed_files, fn_inc) @@ -238,7 +234,7 @@ def collect_use_deps(parsed_files, fn): for i in pf["include"]: fn_inc = normpath(path.join(dirname(fn), i)) - if parsed_files.has_key(fn_inc): + if fn_inc in parsed_files: uses += collect_use_deps(parsed_files, fn_inc) return list(set(uses)) @@ -247,7 +243,7 @@ def collect_use_deps(parsed_files, fn): # ============================================================================= def find_cycles(parsed_files, mod2fn, fn, S=None): pf = parsed_files[fn] - if pf.has_key("visited"): + if "visited" in pf: return if S == None: @@ -260,7 +256,7 @@ def find_cycles(parsed_files, mod2fn, fn, S=None): S.append(m) for m in collect_use_deps(parsed_files, fn): - if mod2fn.has_key(m): + if m in mod2fn: find_cycles(parsed_files, mod2fn, mod2fn[m], S) for m in pf["module"]: diff --git a/tools/plot_mem_from_trace.py b/tools/plot_mem_from_trace.py deleted file mode 100755 index 7c549f40b5..0000000000 --- a/tools/plot_mem_from_trace.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import sys -import re -import matplotlib.pyplot as plt - -# =============================================================================== -def main(): - if len(sys.argv) != 2: - print("Usage: plot_mem_from_trace.py ") - sys.exit(1) - - re_mem = re.compile("Hostmem: (\d+) MB GPUmem: (\d+) MB") - trace_fn = sys.argv[1] - f = open(trace_fn) - hostmem_stats = [] - gpumem_stats = [] - for line in f.readlines(): - m = re_mem.search(line) - if not m: - continue - hostmem_stats.append(m.group(1)) - gpumem_stats.append(m.group(2)) - - fig = plt.figure() - ax1 = fig.add_subplot(111) - - ax1.plot(hostmem_stats, color="red", label="Host") - ax1.set_ylabel("Host Memory Usage [MB]") - ax1.set_xlabel("time") - - ax2 = ax1.twinx() - ax2.plot(gpumem_stats, color="green", label="GPU") - ax2.set_ylabel("GPU Memory Usage [MB]") - - handles1, labels1 = ax1.get_legend_handles_labels() - handles2, labels2 = ax2.get_legend_handles_labels() - plt.legend(handles1 + handles2, labels1 + labels2) - plt.show() - - -# =============================================================================== -main() -# EOF diff --git a/tools/regtesting/check_inputs.py b/tools/regtesting/check_inputs.py index 8061f940c9..43ac64cb67 100755 --- a/tools/regtesting/check_inputs.py +++ b/tools/regtesting/check_inputs.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # author: Ole Schuett diff --git a/tools/regtesting/prettify_TEST_FILES.py b/tools/regtesting/prettify_TEST_FILES.py index 4798293c16..c04303b9a1 100755 --- a/tools/regtesting/prettify_TEST_FILES.py +++ b/tools/regtesting/prettify_TEST_FILES.py @@ -1,5 +1,4 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett diff --git a/tools/regtesting/test_scaling.py b/tools/regtesting/test_scaling.py index 303827150c..6faae04e5e 100755 --- a/tools/regtesting/test_scaling.py +++ b/tools/regtesting/test_scaling.py @@ -1,5 +1,4 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett diff --git a/tools/regtesting/timings.py b/tools/regtesting/timings.py index d6e6a80c11..a835cf1cdc 100755 --- a/tools/regtesting/timings.py +++ b/tools/regtesting/timings.py @@ -1,9 +1,7 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # author: Ole Schuett -from __future__ import print_function import sys import math diff --git a/tools/toolchain/scripts/parse_if.py b/tools/toolchain/scripts/parse_if.py index 98dc13d3a6..e2e1d1ab19 100755 --- a/tools/toolchain/scripts/parse_if.py +++ b/tools/toolchain/scripts/parse_if.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf8 -*- +#!/usr/bin/env python3 import sys