Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced distutils.sysconfig.get_python_lib with sysconfig.get_path #401

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pdoc/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ def main(_args=None):
pass # pdoc was not invoked while in a virtual environment
else:
from glob import glob
from distutils.sysconfig import get_python_lib
libdir = get_python_lib(prefix=venv_dir)
from sysconfig import get_path
libdir = get_path(prefix=venv_dir)
sys.path.append(libdir)
# Resolve egg-links from `setup.py develop` or `pip install -e`
# XXX: Welcome a more canonical approach
Expand Down
4 changes: 2 additions & 2 deletions pdoc/html_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,9 @@ def _project_relative_path(absolute_path):
Assumes the project's path is either the current working directory or
Python library installation.
"""
from distutils.sysconfig import get_python_lib
from sysconfig import get_path
for prefix_path in (_git_project_root() or os.getcwd(),
get_python_lib()):
get_path()):
common_path = os.path.commonpath([prefix_path, absolute_path])
if os.path.samefile(common_path, prefix_path):
# absolute_path is a descendant of prefix_path
Expand Down