Remove dependency to distutils

Because distutils is deprecated since Python 3.10.

Bug: 239631627
Test: atest android.security.cts.SELinuxHostTest
Change-Id: I29d390dcfbeaa65b2c868bbc8648835c644e3d18
(cherry picked from commit 3a9ac6f10a)
Merged-In: I29d390dcfbeaa65b2c868bbc8648835c644e3d18
This commit is contained in:
Inseob Kim 2022-07-19 14:27:36 +09:00
parent 15715aea32
commit 42d563bb62
2 changed files with 5 additions and 4 deletions

View file

@ -18,7 +18,8 @@ import os
import policy
import re
import sys
import distutils.ccompiler
SHARED_LIB_EXTENSION = '.dylib' if sys.platform == 'darwin' else '.so'
#############################################################
# Tests
@ -158,7 +159,7 @@ if __name__ == '__main__':
(options, args) = parser.parse_args()
libpath = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"libsepolwrap" + distutils.ccompiler.new_compiler().shared_lib_extension)
"libsepolwrap" + SHARED_LIB_EXTENSION)
if not os.path.exists(libpath):
sys.exit("Error: libsepolwrap does not exist. Is this binary corrupted?\n")

View file

@ -20,9 +20,9 @@ import policy
from policy import MatchPathPrefix
import re
import sys
import distutils.ccompiler
DEBUG=False
SHARED_LIB_EXTENSION = '.dylib' if sys.platform == 'darwin' else '.so'
'''
Use file_contexts and policy to verify Treble requirements
@ -375,7 +375,7 @@ if __name__ == '__main__':
parser.usage)
libpath = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"libsepolwrap" + distutils.ccompiler.new_compiler().shared_lib_extension)
"libsepolwrap" + SHARED_LIB_EXTENSION)
if not os.path.exists(libpath):
sys.exit("Error: libsepolwrap does not exist. Is this binary corrupted?\n")