FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.8] bpo-21016: pydoc and trace use sysconfig (GH-18476) by miss-islington · Pull Request #18482 · python/cpython · GitHub

Repository navigation

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

Filter by extension

Filter by extension .py  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 2 additions & 3 deletions Lib/pydoc.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 Lib/trace.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 @@ -676,9 +677,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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Back | FazBrowse Home | New Git URL