Migrate build/ to Python 3

Test: mm
Bug: 200119288
Change-Id: I0594074b9a74ec7272da325232e7bd8ec0ec705b
This commit is contained in:
Thiébaud Weksteen 2021-12-06 15:23:18 +11:00
parent 1f117c26c6
commit b05a1a1f75
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)