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

Original file line numberDiff line numberDiff line change

@@ -66,6 +66,7 @@ class or function within a module or module in a package. If the

6666

import platform

6767

import re

6868

import sys

69+

import sysconfig

6970

import time

7071

import tokenize

7172

import urllib.parse

@@ -398,9 +399,7 @@ def fail(self, object, name=None, *args):

398399
399400

docmodule = docclass = docroutine = docother = docproperty = docdata = fail

400401
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')):

404403

"""Return the location of module docs or None"""

405404
406405

try: