Skip to content

Commit d019c79

Browse files
authored
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 fd46561)
1 parent 95b16a9 commit d019c79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_pydoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def get_pydoc_html(module):
361361
def get_pydoc_link(module):
362362
"Returns a documentation web link of a module"
363363
dirname = os.path.dirname
364-
basedir = dirname(dirname(__file__))
364+
basedir = dirname(dirname(os.path.realpath(__file__)))
365365
doc = pydoc.TextDoc()
366366
loc = doc.getdocloc(module, basedir=basedir)
367367
return loc

0 commit comments

Comments
 (0)