mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Linecache contains support for PEP302 loaders, but fails to deal with loaders
that return None to indicate that the module is valid but no source is available. This patch fixes that.
This commit is contained in:
		
							parent
							
								
									fdbebb65af
								
							
						
					
					
						commit
						9015b938cb
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -94,6 +94,10 @@ def updatecache(filename, module_globals=None):
 | 
			
		|||
                    except (ImportError, IOError):
 | 
			
		||||
                        pass
 | 
			
		||||
                    else:
 | 
			
		||||
                        if data is None:
 | 
			
		||||
                            # No luck, the PEP302 loader cannot find the source
 | 
			
		||||
                            # for this module.
 | 
			
		||||
                            return []
 | 
			
		||||
                        cache[filename] = (
 | 
			
		||||
                            len(data), None,
 | 
			
		||||
                            [line+'\n' for line in data.splitlines()], fullname
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue