bpo-21016: pydoc and trace use sysconfig (GH-18476) · python/cpython@ac6f4d2 (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
@@ -392,9 +393,7 @@ def fail(self, object, name=None, *args):
392 393
393 394 docmodule = docclass = docroutine = docother = docproperty = docdata = fail
394 395
395 -def getdocloc(self, object,
396 -basedir=os.path.join(sys.base_exec_prefix, "lib",
397 -"python%d.%d" % sys.version_info[:2])):
396 +def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
398 397 """Return the location of module docs or None"""
399 398
400 399 try: