From 5e0cbdab9bfe0db2d5f8e3c68a8d848f1742b27c Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 21 Aug 2012 15:51:59 -0500 Subject: [PATCH] factory: rescue NameError Due to the new const_defined? checks, passing certain names (such as those that start with a digit) that are illegal constant names will raise NameError. Catch this and error out gracefully, as we would have previously. Fixes Homebrew/homebrew#14342. Signed-off-by: Jack Nagel --- Library/Homebrew/formula.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index f2638bc02d..96ea65ba01 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -403,7 +403,7 @@ class Formula return klass.new(name) if install_type == :from_name return klass.new(name, target_file) - rescue LoadError + rescue LoadError, NameError raise FormulaUnavailableError.new(name) end