mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Issue #16484: Fix pydoc link and test on Windows, by Kaushik Nadikuditi
This commit is contained in:
		
							parent
							
								
									0c0da48aed
								
							
						
					
					
						commit
						4f8aaf6440
					
				
					 3 changed files with 8 additions and 3 deletions
				
			
		|  | @ -28,7 +28,7 @@ class or function within a module or module in a package.  If the | |||
| 
 | ||||
| Module docs for core modules are assumed to be in | ||||
| 
 | ||||
|     http://docs.python.org/X.Y/library/ | ||||
|     https://docs.python.org/X.Y/library/ | ||||
| 
 | ||||
| This can be overridden by setting the PYTHONDOCS environment variable | ||||
| to a different URL or to a local directory containing the Library | ||||
|  | @ -395,6 +395,7 @@ def getdocloc(self, object, | |||
| 
 | ||||
|         docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS) | ||||
| 
 | ||||
|         basedir = os.path.normcase(basedir) | ||||
|         if (isinstance(object, type(os)) and | ||||
|             (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', | ||||
|                                  'marshal', 'posix', 'signal', 'sys', | ||||
|  | @ -402,7 +403,7 @@ def getdocloc(self, object, | |||
|              (file.startswith(basedir) and | ||||
|               not file.startswith(os.path.join(basedir, 'site-packages')))) and | ||||
|             object.__name__ not in ('xml.etree', 'test.pydoc_mod')): | ||||
|             if docloc.startswith("http://"): | ||||
|             if docloc.startswith(("http://", "https://")): | ||||
|                 docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__.lower()) | ||||
|             else: | ||||
|                 docloc = os.path.join(docloc, object.__name__.lower() + ".html") | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Martin Panter
						Martin Panter