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):
500500
501501 # Virtual environment handling for pdoc script run from system site
502502 try :
503- venv_dir = os .environ ['VIRTUAL_ENV' ]
503+ os .environ ['VIRTUAL_ENV' ]
504504 except KeyError :
505505 pass # pdoc was not invoked while in a virtual environment
506506 else :
507507 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" )
514510 sys .path .append (libdir )
515511 # Resolve egg-links from `setup.py develop` or `pip install -e`
516512 # XXX: Welcome a more canonical approach
Original file line number Diff line number Diff line change 44import inspect
55import os
66import re
7- import sys
87import subprocess
98import textwrap
109import traceback
@@ -625,12 +624,8 @@ def _project_relative_path(absolute_path):
625624 Assumes the project's path is either the current working directory or
626625 Python library installation.
627626 """
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" )
634629 for prefix_path in (_git_project_root () or os .getcwd (), libdir ):
635630 common_path = os .path .commonpath ([prefix_path , absolute_path ])
636631 if os .path .samefile (common_path , prefix_path ):
You can’t perform that action at this time.
0 commit comments