| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8c579b1 commit 4fac7ed
3 files changed
| 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: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,6 +52,7 @@ | |||
| 52 | 52 | import linecache | |
| 53 | 53 | import os | |
| 54 | 54 | import sys | |
| 55 | + import sysconfig | ||
| 55 | 56 | import token | |
| 56 | 57 | import tokenize | |
| 57 | 58 | import inspect | |
@@ -660,9 +661,8 @@ def main(): | |||
| 660 | 661 | opts = parser.parse_args() | |
| 661 | 662 | ||
| 662 | 663 | if opts.ignore_dir: | |
| 663 | - rel_path = 'lib', 'python{0.major}.{0.minor}'.format(sys.version_info) | ||
| 664 | - _prefix = os.path.join(sys.base_prefix, *rel_path) | ||
| 665 | - _exec_prefix = os.path.join(sys.base_exec_prefix, *rel_path) | ||
| 664 | + _prefix = sysconfig.get_path("stdlib") | ||
| 665 | + _exec_prefix = sysconfig.get_path("platstdlib") | ||
| 666 | 666 | ||
| 667 | 667 | def parse_ignore_dir(s): | |
| 668 | 668 | s = os.path.expanduser(os.path.expandvars(s)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,4 @@ | |||
| 1 | + The :mod:`pydoc` and :mod:`trace` modules now use the :mod:`sysconfig` | ||
| 2 | + module to get the path to the Python standard library, to support uncommon | ||
| 3 | + installation path like ``/usr/lib64/python3.9/`` on Fedora. | ||
| 4 | + Patch by Jan Matějek. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments