diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 5e8232d9723f4c509763ff6d4a453cc969a55b51..23f9481968aed32249c93543c994662ef7f9cafd 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -836,14 +836,6 @@ class Formula
     method(:post_install).owner == self.class
   end
 
-  # @private
-  def run_post_install
-    build, self.build = self.build, Tab.for_formula(self)
-    post_install
-  ensure
-    self.build = build
-  end
-
   # Tell the user about any caveats regarding this package.
   # @return [String]
   # <pre>def caveats
@@ -1346,7 +1338,6 @@ class Formula
     old_home = ENV["HOME"]
     old_curl_home = ENV["CURL_HOME"]
     ENV["CURL_HOME"] = old_curl_home || old_home
-    build, self.build = self.build, Tab.for_formula(self)
     mktemp("#{name}-test") do |staging|
       staging.retain! if ARGV.keep_tmp?
       @testpath = staging.tmpdir
@@ -1361,7 +1352,6 @@ class Formula
     end
   ensure
     @testpath = nil
-    self.build = build
     ENV["HOME"] = old_home
     ENV["CURL_HOME"] = old_curl_home
   end
diff --git a/Library/Homebrew/postinstall.rb b/Library/Homebrew/postinstall.rb
index 0b6d8f6b01f49228b7572b94db93bc5c701cec04..c5c7ace319c58657be7b96223b824fec6082652a 100644
--- a/Library/Homebrew/postinstall.rb
+++ b/Library/Homebrew/postinstall.rb
@@ -13,7 +13,7 @@ begin
 
   formula = ARGV.resolved_formulae.first
   formula.extend(Debrew::Formula) if ARGV.debug?
-  formula.run_post_install
+  formula.post_install
 rescue Exception => e
   Marshal.dump(e, error_pipe)
   error_pipe.close