Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions 5 Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class or function within a module or module in a package. If the
import platform
import re
import sys
import sysconfig
import time
import tokenize
import urllib.parse
Expand Down Expand Up @@ -392,9 +393,7 @@ def fail(self, object, name=None, *args):

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

def getdocloc(self, object,
basedir=os.path.join(sys.base_exec_prefix, "lib",
"python%d.%d" % sys.version_info[:2])):
def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
"""Return the location of module docs or None"""

try:
Expand Down
6 changes: 3 additions & 3 deletions 6 Lib/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import linecache
import os
import sys
import sysconfig
import token
import tokenize
import inspect
Expand Down Expand Up @@ -660,9 +661,8 @@ def main():
opts = parser.parse_args()

if opts.ignore_dir:
rel_path = 'lib', 'python{0.major}.{0.minor}'.format(sys.version_info)
_prefix = os.path.join(sys.base_prefix, *rel_path)
_exec_prefix = os.path.join(sys.base_exec_prefix, *rel_path)
_prefix = sysconfig.get_path("stdlib")
_exec_prefix = sysconfig.get_path("platstdlib")

def parse_ignore_dir(s):
s = os.path.expanduser(os.path.expandvars(s))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The :mod:`pydoc` and :mod:`trace` modules now use the :mod:`sysconfig`
module to get the path to the Python standard library, to support uncommon
installation path like ``/usr/lib64/python3.9/`` on Fedora.
Patch by Jan Matějek.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.