Loading scripts/gcc-wrapper.py +7 −7 Original line number Diff line number Diff line #! /usr/bin/env python2 #! /usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only # Copyright (c) 2011-2017, 2018 The Linux Foundation. All rights reserved. Loading Loading @@ -32,10 +32,10 @@ ofile = None warning_re = re.compile(r'''(.*/|)([^/]+\.[a-z]+:\d+):(\d+:)? warning:''') def interpret_warning(line): """Decode the message from gcc. The messages we care about have a filename, and a warning""" line = line.rstrip('\n') line = line.rstrip().decode() 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: Loading @@ -60,17 +60,17 @@ def run_gcc(): try: proc = subprocess.Popen(args, stderr=subprocess.PIPE) for line in proc.stderr: print line, print(line, end=' ') 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 Loading Loading
scripts/gcc-wrapper.py +7 −7 Original line number Diff line number Diff line #! /usr/bin/env python2 #! /usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only # Copyright (c) 2011-2017, 2018 The Linux Foundation. All rights reserved. Loading Loading @@ -32,10 +32,10 @@ ofile = None warning_re = re.compile(r'''(.*/|)([^/]+\.[a-z]+:\d+):(\d+:)? warning:''') def interpret_warning(line): """Decode the message from gcc. The messages we care about have a filename, and a warning""" line = line.rstrip('\n') line = line.rstrip().decode() 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: Loading @@ -60,17 +60,17 @@ def run_gcc(): try: proc = subprocess.Popen(args, stderr=subprocess.PIPE) for line in proc.stderr: print line, print(line, end=' ') 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 Loading