mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Use importlib instead of calling __import__ directly.
This commit is contained in:
		
							parent
							
								
									2eb2f5e359
								
							
						
					
					
						commit
						613cf25d2a
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1210,8 +1210,7 @@ def runtest_inner(test, verbose, quiet,
 | 
			
		|||
            abstest = 'test.' + test
 | 
			
		||||
        with saved_test_environment(test, verbose, quiet) as environment:
 | 
			
		||||
            start_time = time.time()
 | 
			
		||||
            the_package = __import__(abstest, globals(), locals(), [])
 | 
			
		||||
            the_module = getattr(the_package, test)
 | 
			
		||||
            the_module = importlib.import_module(abstest)
 | 
			
		||||
            # If the test has a test_main, that will run the appropriate
 | 
			
		||||
            # tests.  If not, use normal unittest test loading.
 | 
			
		||||
            test_runner = getattr(the_module, "test_main", None)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue