File tree Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -500,17 +500,13 @@ def main(_args=None):
500
500
501
501
# Virtual environment handling for pdoc script run from system site
502
502
try :
503
- venv_dir = os .environ ['VIRTUAL_ENV' ]
503
+ os .environ ['VIRTUAL_ENV' ]
504
504
except KeyError :
505
505
pass # pdoc was not invoked while in a virtual environment
506
506
else :
507
507
from glob import glob
508
- if sys .version_info >= (3 , 11 ):
509
- from sysconfig import get_path
510
- libdir = get_path ("platlib" )
511
- else :
512
- from distutils .sysconfig import get_python_lib
513
- libdir = get_python_lib (prefix = venv_dir )
508
+ from sysconfig import get_path
509
+ libdir = get_path ("platlib" )
514
510
sys .path .append (libdir )
515
511
# Resolve egg-links from `setup.py develop` or `pip install -e`
516
512
# XXX: Welcome a more canonical approach
Original file line number Diff line number Diff line change 4
4
import inspect
5
5
import os
6
6
import re
7
- import sys
8
7
import subprocess
9
8
import textwrap
10
9
import traceback
@@ -625,12 +624,8 @@ def _project_relative_path(absolute_path):
625
624
Assumes the project's path is either the current working directory or
626
625
Python library installation.
627
626
"""
628
- if sys .version_info >= (3 , 11 ):
629
- from sysconfig import get_path
630
- libdir = get_path ("platlib" )
631
- else :
632
- from distutils .sysconfig import get_python_lib
633
- libdir = get_python_lib ()
627
+ from sysconfig import get_path
628
+ libdir = get_path ("platlib" )
634
629
for prefix_path in (_git_project_root () or os .getcwd (), libdir ):
635
630
common_path = os .path .commonpath ([prefix_path , absolute_path ])
636
631
if os .path .samefile (common_path , prefix_path ):
You can’t perform that action at this time.
0 commit comments