diff --git a/mercurial/patch.py b/mercurial/patch.py
index 0f33abfccaa1bdaf2b1851013a8f5f59e90d3a9a_bWVyY3VyaWFsL3BhdGNoLnB5..ad764a6a2eede95eb9ef1498c27bc35ba6480b3e_bWVyY3VyaWFsL3BhdGNoLnB5 100644
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -534,10 +534,6 @@
             dest = self.fname
         self.writelines(dest, self.lines)
 
-    def close(self):
-        self.write()
-        self.write_rej()
-
     def apply(self, h):
         if not h.complete():
             raise PatchError(_("bad hunk #%d %s (%d %d %d %d)") %
@@ -1159,7 +1155,8 @@
     def closefile():
         if not current_file:
             return 0
-        current_file.close()
+        current_file.write()
+        current_file.write_rej()
         return len(current_file.rej)
 
     for state, values in iterhunks(ui, fp, sourcefile):