]> granicus.if.org Git - python/commitdiff
Merged revisions 79518 via svnmerge from
authorBrian Curtin <brian.curtin@gmail.com>
Wed, 31 Mar 2010 03:14:27 +0000 (03:14 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Wed, 31 Mar 2010 03:14:27 +0000 (03:14 +0000)
svn+ssh://pythondev@svn.python.org/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.
........

Lib/pydoc.py
Lib/test/test_pydoc.py

index e9832126d026e9618d132024e8628b0b4c1a2430..03c0d09a2e26d24c2c17060c306110f981ed5329 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 168c4d135a401b0d39d7aa16dd98138d107d6817..d23de74067b26c41ee95f53f2e583a1fdf5916de 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 TESTFN, forget, rmtree, EnvironmentVarGuard
@@ -236,6 +237,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)