diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-07-27 16:05:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 16:05:46 (GMT) |
commit | d019c7965d411b2132f68ed6bb33e538b4d9eba3 (patch) | |
tree | 5e35113e17bfafd995d7da0307d73e3358328834 /Lib/test/test_pydoc.py | |
parent | 95b16a9705d6b4d31c016c014e59744fc33d53ea (diff) | |
download | cpython-d019c7965d411b2132f68ed6bb33e538b4d9eba3.zip cpython-d019c7965d411b2132f68ed6bb33e538b4d9eba3.tar.gz cpython-d019c7965d411b2132f68ed6bb33e538b4d9eba3.tar.bz2 |
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)
Diffstat (limited to 'Lib/test/test_pydoc.py')
-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 ed438d5..0383a67 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 |