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 <jacknagel@gmail.com>
This commit is contained in:
parent
98b6f24510
commit
5e0cbdab9b
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user