ruby-changes:60276
From: Charles <ko1@a...>
Date: Wed, 4 Mar 2020 00:11:36 +0900 (JST)
Subject: [ruby-changes:60276] 03f9e8746e (master): Don't tweak RubyVM compile options if it's not defined
https://git.ruby-lang.org/ruby.git/commit/?id=03f9e8746e From 03f9e8746e42a4835583678af217cdf4c417bd05 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter <headius@h...> Date: Sun, 23 Feb 2020 12:49:26 -0800 Subject: Don't tweak RubyVM compile options if it's not defined diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 73cf625..300033a 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -3,17 +3,21 @@ require 'test/unit' https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L3 class TestSetTraceFunc < Test::Unit::TestCase def setup - @original_compile_option = RubyVM::InstructionSequence.compile_option - RubyVM::InstructionSequence.compile_option = { - :trace_instruction => true, - :specialized_instruction => false - } + if defined?(RubyVM) + @original_compile_option = RubyVM::InstructionSequence.compile_option + RubyVM::InstructionSequence.compile_option = { + :trace_instruction => true, + :specialized_instruction => false + } + end @target_thread = Thread.current end def teardown set_trace_func(nil) - RubyVM::InstructionSequence.compile_option = @original_compile_option + if defined?(RubyVM) + RubyVM::InstructionSequence.compile_option = @original_compile_option + end @target_thread = nil end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/