diff --git a/gccdeps.py b/gccdeps.py index 1fc9373489..fe393b571d 100644 --- a/gccdeps.py +++ b/gccdeps.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding: utf-8 # Thomas Nagy, 2008-2010 (ita) diff --git a/long_gcc.py b/long_gcc.py index 20ca2a7f77..1ec49c4c3c 100644 --- a/long_gcc.py +++ b/long_gcc.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # encoding: utf-8 """ diff --git a/rtems-bsps b/rtems-bsps index 79ea745753..c58e3f5681 100755 --- a/rtems-bsps +++ b/rtems-bsps @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # # RTEMS (http://www.rtems.org/) # Copyright 2020, 2022 Chris Johns (chrisj@rtems.org) diff --git a/testsuites/build/bin/fake-rtems5-ar b/testsuites/build/bin/fake-rtems5-ar index 899dc2c011..46fc8b821f 100755 --- a/testsuites/build/bin/fake-rtems5-ar +++ b/testsuites/build/bin/fake-rtems5-ar @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-2-Clause # diff --git a/testsuites/build/bin/fake-rtems5-gcc b/testsuites/build/bin/fake-rtems5-gcc index 80198fad4d..4f96406a97 100755 --- a/testsuites/build/bin/fake-rtems5-gcc +++ b/testsuites/build/bin/fake-rtems5-gcc @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-2-Clause # @@ -28,14 +28,14 @@ import argparse import sys -sys.argv = list(filter(lambda a: a != '-', sys.argv)) +sys.argv = list([a for a in sys.argv if a != '-']) parser = argparse.ArgumentParser() parser.add_argument('-E', action='count') parser.add_argument('-dM', action='count') args = parser.parse_args() -if args.E > 0: +if args.E and args.E > 0: print("#define __GNUC__ 7") print("#define __GNUC_MINOR__ 4") print("#define __GNUC_PATCHLEVEL__ 0") diff --git a/testsuites/build/bin/fake-rtems5-ld b/testsuites/build/bin/fake-rtems5-ld index 899dc2c011..46fc8b821f 100755 --- a/testsuites/build/bin/fake-rtems5-ld +++ b/testsuites/build/bin/fake-rtems5-ld @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-2-Clause # diff --git a/testsuites/build/test.py b/testsuites/build/test.py index 084cd2b673..ea158bdfec 100755 --- a/testsuites/build/test.py +++ b/testsuites/build/test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-2-Clause # diff --git a/testsuites/rtems-test-check.py b/testsuites/rtems-test-check.py index 8af841957f..9c0bd52ceb 100755 --- a/testsuites/rtems-test-check.py +++ b/testsuites/rtems-test-check.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # # Copyright 2018 Chris Johns (chrisj@rtems.org) # All rights reserved. @@ -33,12 +33,9 @@ # Python version the rtems-test-check script. # -from __future__ import print_function - import os import os.path import re -import sre_constants import sys def eprint(*args, **kwargs): @@ -219,7 +216,7 @@ for test in tests: for e in testdata['rexclude']: try: m = re.compile(e).match(test) - except sre_constants.error as ree: + except re.error as ree: eprint('error: invalid rexclude regx: %s: %s' % (e, ree)) print('INVALID-TEST-DATA') sys.exit(1) @@ -229,7 +226,7 @@ for test in tests: for i in testdata['rinclude']: try: m = re.compile(i).match(test) - except sre_constants.error as ree: + except re.error as ree: eprint('error: invalid rinclude regx: %s: %s' % (i, ree)) print('INVALID-TEST-DATA') sys.exit(1) @@ -248,7 +245,7 @@ for test in tests: for ftest in testdata['flags'][mode]: try: m = re.compile(ftest).match(test) - except sre_constants.error as ref: + except re.error as ref: eprint('error: invalid flags test regx: %s: %s' % (ftest, ref)) print('INVALID-TEST-DATA') sys.exit(1)