bpo-34182: Fix test_pydoc running as a script. (GH-8389)
(cherry picked from commit 4e11c461ed
)
Co-authored-by: Bo Bayles <bbayles@gmail.com>
This commit is contained in:
parent
5753b13cb9
commit
990de2f4ca
|
@ -357,8 +357,9 @@ def get_pydoc_html(module):
|
||||||
|
|
||||||
def get_pydoc_link(module):
|
def get_pydoc_link(module):
|
||||||
"Returns a documentation web link of a module"
|
"Returns a documentation web link of a module"
|
||||||
|
abspath = os.path.abspath
|
||||||
dirname = os.path.dirname
|
dirname = os.path.dirname
|
||||||
basedir = dirname(dirname(__file__))
|
basedir = dirname(dirname(abspath(__file__)))
|
||||||
doc = pydoc.TextDoc()
|
doc = pydoc.TextDoc()
|
||||||
loc = doc.getdocloc(module, basedir=basedir)
|
loc = doc.getdocloc(module, basedir=basedir)
|
||||||
return loc
|
return loc
|
||||||
|
|
Loading…
Reference in New Issue