mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
Merge "scripts: update gcc-wrapper to python3"
This commit is contained in:
commit
ac1ea4edfd
1 changed files with 7 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#! /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.
|
||||
|
||||
|
|
@ -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:
|
||||
|
|
@ -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…
Reference in a new issue