]> granicus.if.org Git - python/commitdiff
Fix #8225. xml.etree was displaying an incorrect link when viewed in help.
authorBrian Curtin <brian.curtin@gmail.com>
Wed, 31 Mar 2010 03:10:21 +0000 (03:10 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Wed, 31 Mar 2010 03:10:21 +0000 (03:10 +0000)
Lib/pydoc.py
Lib/test/test_pydoc.py

index 7a55023319ec447435bba3cc536d8418eea40ea5..2c954de3b46f4f94cec97c38860d0c4d9a64269f 100755 (executable)
@@ -356,7 +356,8 @@ class Doc:
                                  'marshal', 'posix', 'signal', 'sys',
                                  'thread', 'zipimport') or
              (file.startswith(basedir) and
-              not file.startswith(os.path.join(basedir, 'site-packages'))))):
+              not file.startswith(os.path.join(basedir, 'site-packages')))) and
+            object.__name__ not in ('xml.etree')):
             if docloc.startswith("http://"):
                 docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__)
             else:
index 43ad2c16d2ca2a15fa6f4c15cc9ec5b32acd7fef..0685488edb29767f4815cf45450c9a3919dc2a15 100644 (file)
@@ -7,6 +7,7 @@ import re
 import pydoc
 import inspect
 import unittest
+import xml.etree
 import test.test_support
 from contextlib import contextmanager
 from test.test_support import (
@@ -244,6 +245,11 @@ class PyDocDocTest(unittest.TestCase):
             print_diffs(expected_text, result)
             self.fail("outputs are not equal, see diff above")
 
+    def test_issue8225(self):
+        # Test issue8225 to ensure no doc link appears for xml.etree
+        result, doc_loc = get_pydoc_text(xml.etree)
+        self.assertEqual(doc_loc, "", "MODULE DOCS incorrectly includes a link")
+
     def test_not_here(self):
         missing_module = "test.i_am_not_here"
         result = run_pydoc(missing_module)