]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34182: Fix test_pydoc running as a script. (GH-8389)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 29 Jul 2018 19:50:33 +0000 (12:50 -0700)
committerGitHub <noreply@github.com>
Sun, 29 Jul 2018 19:50:33 +0000 (12:50 -0700)
(cherry picked from commit 4e11c461ed39085b8495a35c9367b46d8a0d306d)

Co-authored-by: Bo Bayles <bbayles@gmail.com>
Lib/test/test_pydoc.py

index 37af6643f6dcfb094e882a1aa7074d69c1f5641d..06f872999515fba6e67fc0ade6f5fa03f7a0b6ff 100644 (file)
@@ -357,8 +357,9 @@ def get_pydoc_html(module):
 
 def get_pydoc_link(module):
     "Returns a documentation web link of a module"
+    abspath = os.path.abspath
     dirname = os.path.dirname
-    basedir = dirname(dirname(__file__))
+    basedir = dirname(dirname(abspath(__file__)))
     doc = pydoc.TextDoc()
     loc = doc.getdocloc(module, basedir=basedir)
     return loc