Fix Homebrew issue #31889

This commit applies the fix proposed by MithrilTuxedo. I tested it on my machine and I can confirm that the patch fixes the issue.