mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
This commit is contained in:
		
						commit
						7a2f0c7802
					
				
					 2 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -218,8 +218,8 @@ def source_synopsis(file):
 | 
			
		|||
def synopsis(filename, cache={}):
 | 
			
		||||
    """Get the one-line summary out of a module file."""
 | 
			
		||||
    mtime = os.stat(filename).st_mtime
 | 
			
		||||
    lastupdate, result = cache.get(filename, (0, None))
 | 
			
		||||
    if lastupdate < mtime:
 | 
			
		||||
    lastupdate, result = cache.get(filename, (None, None))
 | 
			
		||||
    if lastupdate is None or lastupdate < mtime:
 | 
			
		||||
        info = inspect.getmoduleinfo(filename)
 | 
			
		||||
        try:
 | 
			
		||||
            file = tokenize.open(filename)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue