mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #13591: import_module potentially imports a module twice.
This commit is contained in:
		
							parent
							
								
									061c0289af
								
							
						
					
					
						commit
						416f12ddb3
					
				
					 4 changed files with 29 additions and 2 deletions
				
			
		|  | @ -816,7 +816,9 @@ def _gcd_import(name, package=None, level=0): | |||
|         for finder in meta_path: | ||||
|             loader = finder.find_module(name, path) | ||||
|             if loader is not None: | ||||
|                 loader.load_module(name) | ||||
|                 # The parent import may have already imported this module. | ||||
|                 if name not in sys.modules: | ||||
|                     loader.load_module(name) | ||||
|                 break | ||||
|         else: | ||||
|             raise ImportError(_ERR_MSG.format(name)) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Meador Inge
						Meador Inge