Skip to content

Commit fd6736d

Browse files
authored
bpo-31028: Fix test_pydoc when run directly (#2864) (#2911)
* 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 29094ce commit fd6736d

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
@@ -257,7 +257,7 @@ def get_pydoc_html(module):
257257
def get_pydoc_link(module):
258258
"Returns a documentation web link of a module"
259259
dirname = os.path.dirname
260-
basedir = dirname(dirname(__file__))
260+
basedir = dirname(dirname(os.path.realpath(__file__)))
261261
doc = pydoc.TextDoc()
262262
loc = doc.getdocloc(module, basedir=basedir)
263263
return loc

0 commit comments

Comments
 (0)