From e143c3a799b531d6b3793f7bb677652f418d7a46 Mon Sep 17 00:00:00 2001
From: Samuel John <github@SamuelJohn.de>
Date: Mon, 15 Jul 2013 21:28:37 +0200
Subject: [PATCH] Fix multiple execution of python do ... end blocks

Only run the `python do ... end` loop once even if
multiple `depends_on :python => 'module-name'` are
present.
---
 Library/Homebrew/python_helper.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Library/Homebrew/python_helper.rb b/Library/Homebrew/python_helper.rb
index 13ff283488..b121ca5d75 100644
--- a/Library/Homebrew/python_helper.rb
+++ b/Library/Homebrew/python_helper.rb
@@ -39,7 +39,8 @@ def python_helper(options={:allowed_major_versions => [2, 3]}, &block)
     if !filtered_python_reqs.map{ |fpr| fpr.binary }.include?(py.binary) &&
        py.satisfied? &&
        options[:allowed_major_versions].include?(py.version.major) &&
-       self.build.with?(py.name) || !(py.optional? || py.recommended?)
+       # if optional or recommended then check the build.with?
+       (self.build.with?(py.name) || !(py.optional? || py.recommended?))
     then
       filtered_python_reqs << py
     end
-- 
GitLab