Skip to content

Commit fd46561

Browse files
authored
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()
1 parent a80e985 commit fd46561

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
@@ -360,7 +360,7 @@ def get_pydoc_html(module):
360360
def get_pydoc_link(module):
361361
"Returns a documentation web link of a module"
362362
dirname = os.path.dirname
363-
basedir = dirname(dirname(__file__))
363+
basedir = dirname(dirname(os.path.realpath(__file__)))
364364
doc = pydoc.TextDoc()
365365
loc = doc.getdocloc(module, basedir=basedir)
366366
return loc

0 commit comments

Comments
 (0)