Merge "Migrate build/ to Python 3"

This commit is contained in:
Thiébaud Weksteen 2021-12-08 05:56:27 +00:00 committed by Gerrit Code Review
commit a1a894be50
3 changed files with 3 additions and 9 deletions

View file

@ -31,12 +31,4 @@ python_binary_host {
"secilc",
"version_policy",
],
version: {
py2: {
enabled: true,
},
py3: {
enabled: false,
},
},
}

2
build/build_sepolicy.py Normal file → Executable file
View file

@ -1,3 +1,5 @@
#!/usr/bin/env python3
#
# Copyright 2018 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");

View file

@ -39,7 +39,7 @@ def filter_out(pattern_files, input_file):
patterns.extend(open(f).readlines())
# Copy lines that are not in the pattern.
tmp_output = tempfile.NamedTemporaryFile()
tmp_output = tempfile.NamedTemporaryFile(mode='w+')
with open(input_file, 'r') as in_file:
tmp_output.writelines(line for line in in_file.readlines()
if line not in patterns)