diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 3a9f37f964..be1fdf5320 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -941,7 +941,7 @@ class Formula end def prepare_patches - active_spec.add_legacy_patches(patches) + active_spec.add_legacy_patches(patches) if respond_to?(:patches) patchlist.grep(DATAPatch) { |p| p.path = path } diff --git a/Library/Homebrew/test/test_patching.rb b/Library/Homebrew/test/test_patching.rb index 0917316dd9..02c73ef8ed 100644 --- a/Library/Homebrew/test/test_patching.rb +++ b/Library/Homebrew/test/test_patching.rb @@ -106,7 +106,7 @@ class PatchingTests < Homebrew::TestCase def test_patch_DATA_constant assert_patched formula("test", Pathname.new(__FILE__).expand_path) { def patches - Formula::DATA + :DATA end } end