mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	bpo-35952: Fix test.pythoninfo when the compiler is missing (GH-13007)
This commit is contained in:
		
							parent
							
								
									843bf42aa6
								
							
						
					
					
						commit
						a86e06433a
					
				
					 2 changed files with 12 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -571,10 +571,17 @@ def collect_cc(info_add):
 | 
			
		|||
    except ImportError:
 | 
			
		||||
        args = CC.split()
 | 
			
		||||
    args.append('--version')
 | 
			
		||||
    proc = subprocess.Popen(args,
 | 
			
		||||
                            stdout=subprocess.PIPE,
 | 
			
		||||
                            stderr=subprocess.STDOUT,
 | 
			
		||||
                            universal_newlines=True)
 | 
			
		||||
    try:
 | 
			
		||||
        proc = subprocess.Popen(args,
 | 
			
		||||
                                stdout=subprocess.PIPE,
 | 
			
		||||
                                stderr=subprocess.STDOUT,
 | 
			
		||||
                                universal_newlines=True)
 | 
			
		||||
    except OSError:
 | 
			
		||||
        # Cannot run the compiler, for example when Python has been
 | 
			
		||||
        # cross-compiled and installed on the target platform where the
 | 
			
		||||
        # compiler is missing.
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
    stdout = proc.communicate()[0]
 | 
			
		||||
    if proc.returncode:
 | 
			
		||||
        # CC --version failed: ignore error
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue