Skip to content

Commit 8bc1bb9

Browse files
mak-dunkelzifferkratob
authored andcommitted
Ruby 3.3: rack: don't override Tempfile#_close anymore
1 parent c8004a3 commit 8bc1bb9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

rack/lib/rack/rewindable_input.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ def close
5959

6060
# Ruby's Tempfile class has a bug. Subclass it and fix it.
6161
class Tempfile < ::Tempfile
62-
def _close
63-
@tmpfile.close if @tmpfile
64-
@data[1] = nil if @data
65-
@tmpfile = nil
62+
if RUBY_VERSION < '3'
63+
def _close
64+
@tmpfile.close if @tmpfile
65+
@data[1] = nil if @data
66+
@tmpfile = nil
67+
end
6668
end
6769
end
6870

0 commit comments

Comments
 (0)