versions: unload constant before calling Formula.factory
Closes Homebrew/homebrew#18634. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
c6b0b563e8
commit
ad622a9e87
@ -68,8 +68,8 @@ class Formula
|
|||||||
|
|
||||||
# Unload the class so Formula#version returns the correct value
|
# Unload the class so Formula#version returns the correct value
|
||||||
begin
|
begin
|
||||||
version = nostdout { Formula.factory(path).version }
|
|
||||||
Object.send(:remove_const, Formula.class_s(name))
|
Object.send(:remove_const, Formula.class_s(name))
|
||||||
|
version = nostdout { Formula.factory(path).version }
|
||||||
version
|
version
|
||||||
rescue SyntaxError, TypeError, NameError, ArgumentError
|
rescue SyntaxError, TypeError, NameError, ArgumentError
|
||||||
# We rescue these so that we can skip bad versions and
|
# We rescue these so that we can skip bad versions and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user