Skip to content

Commit ad1bcb1

Browse files
WillHaltoko1
authored andcommitted
restrict skip to ruby 3.1 and later
1 parent 0476b3d commit ad1bcb1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/debug/session.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,12 @@ def initialize
127127

128128
@tp_thread_begin = nil
129129
@tp_load_script = TracePoint.new(:script_compiled){|tp|
130-
# skip on_load if no bps for faster loading
131-
ThreadClient.current.on_load tp.instruction_sequence, tp.eval_script if @bps.any?
130+
if RUBY_VERSION >= '3.1.0'
131+
# skip on_load if no bps for faster loading
132+
ThreadClient.current.on_load tp.instruction_sequence, tp.eval_script if @bps.any?
133+
else
134+
ThreadClient.current.on_load tp.instruction_sequence, tp.eval_script
135+
end
132136
}
133137
@tp_load_script.enable
134138

0 commit comments

Comments
 (0)