mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Issue #15110: Also hide importlib frames when importing a builtin module fails.
This commit is contained in:
		
							parent
							
								
									9ed37433c4
								
							
						
					
					
						commit
						ae7b8f07c1
					
				
					 2 changed files with 2748 additions and 2729 deletions
				
			
		|  | @ -490,12 +490,16 @@ def load_module(cls, fullname): | |||
|         """Load a built-in module.""" | ||||
|         is_reload = fullname in sys.modules | ||||
|         try: | ||||
|             return _imp.init_builtin(fullname) | ||||
|             return cls._exec_module(fullname) | ||||
|         except: | ||||
|             if not is_reload and fullname in sys.modules: | ||||
|                 del sys.modules[fullname] | ||||
|             raise | ||||
| 
 | ||||
|     @classmethod | ||||
|     def _exec_module(cls, fullname): | ||||
|         return _imp.init_builtin(fullname) | ||||
| 
 | ||||
|     @classmethod | ||||
|     @_requires_builtin | ||||
|     def get_code(cls, fullname): | ||||
|  |  | |||
							
								
								
									
										5471
									
								
								Python/importlib.h
									
										
									
									
									
								
							
							
						
						
									
										5471
									
								
								Python/importlib.h
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Amaury Forgeot d'Arc
						Amaury Forgeot d'Arc