commit d5a70cdd4e2ce4ee432011504ea0fdfa0096ef7e Author: Alexey Min Date: Sat May 2 00:22:09 2020 +0300 gcc-wrapper: port to py3 diff --git a/scripts/gcc-wrapper.py b/scripts/gcc-wrapper.py index 83f7e99da3b..499aac09244 100755 --- a/scripts/gcc-wrapper.py +++ b/scripts/gcc-wrapper.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. @@ -59,7 +59,7 @@ def interpret_warning(line): line = line.rstrip('\n') m = warning_re.match(line) if m and m.group(2) not in allowed_warnings: - print "error, forbidden warning:", m.group(2) + print("error, forbidden warning:", m.group(2)) # If there is a warning, remove any object if it exists. if ofile: @@ -84,17 +84,16 @@ def run_gcc(): try: proc = subprocess.Popen(args, stderr=subprocess.PIPE) for line in proc.stderr: - print line, - interpret_warning(line) + print(line, interpret_warning(line)) result = proc.wait() except OSError as e: result = e.errno if result == errno.ENOENT: - print args[0] + ':',e.strerror - print 'Is your PATH set correctly?' + print(args[0] + ':', e.strerror) + print('Is your PATH set correctly?') else: - print ' '.join(args), str(e) + print(' '.join(args), str(e)) return result