[Python-checkins] bpo-34182: Fix test_pydoc running as a script. (GH-8389)

Miss Islington (bot) webhook-mailer at python.org
Sun Jul 29 15:50:39 EDT 2018


https://github.com/python/cpython/commit/990de2f4ca734ddaa196e2af64caafb9c77f29e0
commit: 990de2f4ca734ddaa196e2af64caafb9c77f29e0
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-07-29T12:50:33-07:00
summary:

bpo-34182: Fix test_pydoc running as a script. (GH-8389)

(cherry picked from commit 4e11c461ed39085b8495a35c9367b46d8a0d306d)

Co-authored-by: Bo Bayles <bbayles at gmail.com>

files:
M Lib/test/test_pydoc.py

diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 37af6643f6dc..06f872999515 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -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



More information about the Python-checkins mailing list