Removed distutils use in mcpyrate

This commit is contained in:
Salvador E. Tropea 2022-06-30 13:58:54 -03:00
parent c5f55d39bb
commit 5b732867f5
1 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,6 @@
__all__ = ["source_to_xcode", "path_xstats", "path_stats"]
import ast
import distutils.sysconfig
from importlib.machinery import SourceFileLoader
import importlib.util
import os
@ -85,7 +84,9 @@ def _detect_stdlib_sourcefile_paths():
"""Return a set of full paths of `.py` files that are part of Python's standard library."""
# Adapted from StackOverflow answer by Adam Spiers, https://stackoverflow.com/a/8992937
# Note we don't want to get module names, but full paths to `.py` files.
stdlib_dir = distutils.sysconfig.get_python_lib(standard_lib=True)
# stdlib_dir = distutils.sysconfig.get_python_lib(standard_lib=True)
# To avoid distutils: (not default on Debian and deprecated)
stdlib_dir = os.path.dirname(os.__file__)
paths = set()
for root, dirs, files in os.walk(stdlib_dir):
for filename in files: