diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-07-27 09:21:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 09:21:26 (GMT) |
commit | fd46561167af6cd697191dd7ebb8c2fef5ad6493 (patch) | |
tree | c02bc877142b82313f23059b51c4f8a697c01519 /Lib | |
parent | a80e985c493d2ab9df0832c99d9ddb798d2e66cf (diff) | |
download | cpython-fd46561167af6cd697191dd7ebb8c2fef5ad6493.zip cpython-fd46561167af6cd697191dd7ebb8c2fef5ad6493.tar.gz cpython-fd46561167af6cd697191dd7ebb8c2fef5ad6493.tar.bz2 |
bpo-31028: Fix test_pydoc when run directly (#2864)
* 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()
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_pydoc.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 6813d15..d68ab55 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -360,7 +360,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 |