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:
Miss Islington (bot) 2018-07-29 12:50:33 -07:00 committed by GitHub
parent 5753b13cb9
commit 990de2f4ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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