bpo-21016: pydoc and trace use sysconfig (GH-18476) · python/cpython@ca133e5 (original) (raw)

Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@ class or function within a module or module in a package. If the
66 66 import platform
67 67 import re
68 68 import sys
69 +import sysconfig
69 70 import time
70 71 import tokenize
71 72 import urllib.parse
@@ -398,9 +399,7 @@ def fail(self, object, name=None, *args):
398 399
399 400 docmodule = docclass = docroutine = docother = docproperty = docdata = fail
400 401
401 -def getdocloc(self, object,
402 -basedir=os.path.join(sys.base_exec_prefix, "lib",
403 -"python%d.%d" % sys.version_info[:2])):
402 +def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
404 403 """Return the location of module docs or None"""
405 404
406 405 try: