Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d8a1dd

Browse files
committed
Merged revisions 79520 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ................ r79520 | brian.curtin | 2010-03-30 22:19:28 -0500 (Tue, 30 Mar 2010) | 9 lines Merged revisions 79518 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r79518 | brian.curtin | 2010-03-30 22:10:21 -0500 (Tue, 30 Mar 2010) | 2 lines Fix #8225. xml.etree was displaying an incorrect link when viewed in help. ........ ................
1 parent b820f08 commit 0d8a1dd

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lib/pydoc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ def getdocloc(self, object):
349349
'marshal', 'posix', 'signal', 'sys',
350350
'_thread', 'zipimport') or
351351
(file.startswith(basedir) and
352-
not file.startswith(os.path.join(basedir, 'site-packages'))))):
352+
not file.startswith(os.path.join(basedir, 'site-packages')))) and
353+
object.__name__ not in ('xml.etree')):
353354
if docloc.startswith("http://"):
354355
docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__)
355356
else:

Lib/test/test_pydoc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import inspect
99
import unittest
1010
import test.support
11+
import xml.etree
1112
from contextlib import contextmanager
1213
from test.support import TESTFN, forget, rmtree, EnvironmentVarGuard
1314

@@ -253,6 +254,11 @@ def test_text_doc(self):
253254
print_diffs(expected_text, result)
254255
self.fail("outputs are not equal, see diff above")
255256

257+
def test_issue8225(self):
258+
# Test issue8225 to ensure no doc link appears for xml.etree
259+
result, doc_loc = get_pydoc_text(xml.etree)
260+
self.assertEqual(doc_loc, "", "MODULE DOCS incorrectly includes a link")
261+
256262
def test_not_here(self):
257263
missing_module = "test.i_am_not_here"
258264
result = str(run_pydoc(missing_module), 'ascii')

0 commit comments

Comments
 (0)