language/python: handle python@* in each_python
This commit is contained in:
		
							parent
							
								
									e3be551244
								
							
						
					
					
						commit
						04cec369c7
					
				@ -15,10 +15,11 @@ module Language
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def self.each_python(build, &block)
 | 
					    def self.each_python(build, &block)
 | 
				
			||||||
      original_pythonpath = ENV["PYTHONPATH"]
 | 
					      original_pythonpath = ENV["PYTHONPATH"]
 | 
				
			||||||
      ["python", "python3"].each do |python|
 | 
					      { "python@3" => "python3", "python@2" => "python2.7" }.each do |python_formula, python|
 | 
				
			||||||
        next if build.without? python
 | 
					        python_formula = Formulary.factory(python_formula)
 | 
				
			||||||
 | 
					        next if build.without? python_formula.to_s
 | 
				
			||||||
        version = major_minor_version python
 | 
					        version = major_minor_version python
 | 
				
			||||||
        ENV["PYTHONPATH"] = if Formulary.factory(python).installed?
 | 
					        ENV["PYTHONPATH"] = if python_formula.installed?
 | 
				
			||||||
          nil
 | 
					          nil
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
          homebrew_site_packages(version)
 | 
					          homebrew_site_packages(version)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user