Remove deprecated distutils dependency
Test: manual
Change-Id: I18747dc6dc47d8e865cadb87dee4a88d1ec32d49
diff --git a/tools/sepolicy_generate_compat.py b/tools/sepolicy_generate_compat.py
index 17a4d75..5234125 100644
--- a/tools/sepolicy_generate_compat.py
+++ b/tools/sepolicy_generate_compat.py
@@ -15,7 +15,6 @@
# limitations under the License.
import argparse
-import distutils.ccompiler
import glob
import logging
import mini_parser
@@ -41,6 +40,7 @@
))
"""
+SHARED_LIB_EXTENSION = '.dylib' if sys.platform == 'darwin' else '.so'
def check_run(cmd, cwd=None):
if cwd:
@@ -227,8 +227,7 @@
try:
libpath = os.path.join(
- os.path.dirname(os.path.realpath(__file__)), 'libsepolwrap' +
- distutils.ccompiler.new_compiler().shared_lib_extension)
+ os.path.dirname(os.path.realpath(__file__)), 'libsepolwrap' + SHARED_LIB_EXTENSION)
if not os.path.exists(libpath):
sys.exit(
'Error: libsepolwrap does not exist. Is this binary corrupted?\n'