mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Fix #8225. xml.etree was displaying an incorrect link when viewed in help.
This commit is contained in:
		
							parent
							
								
									b102ddadcb
								
							
						
					
					
						commit
						aeb2e8295d
					
				
					 2 changed files with 8 additions and 1 deletions
				
			
		|  | @ -356,7 +356,8 @@ def getdocloc(self, object): | |||
|                                  '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: | ||||
|  |  | |||
|  | @ -7,6 +7,7 @@ | |||
| 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 @@ def test_text_doc(self): | |||
|             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) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brian Curtin
						Brian Curtin