From: Victor Stinner Date: Thu, 27 Jul 2017 16:05:46 +0000 (+0200) Subject: bpo-31028: Fix test_pydoc when run directly (#2864) (#2910) X-Git-Tag: v3.6.3rc1~193 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d019c7965d411b2132f68ed6bb33e538b4d9eba3;p=python bpo-31028: Fix test_pydoc when run directly (#2864) (#2910) * bpo-31028: Fix test_pydoc when run directly Fix get_pydoc_link() of test_pydoc to fix "./python Lib/test/test_pydoc.py": get the absolute path to __file__ to prevent relative directories. * Use realpath() instead of abspath() (cherry picked from commit fd46561167af6cd697191dd7ebb8c2fef5ad6493) --- diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index ed438d5664..0383a67324 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -361,7 +361,7 @@ def get_pydoc_html(module): def get_pydoc_link(module): "Returns a documentation web link of a module" dirname = os.path.dirname - basedir = dirname(dirname(__file__)) + basedir = dirname(dirname(os.path.realpath(__file__))) doc = pydoc.TextDoc() loc = doc.getdocloc(module, basedir=basedir) return loc