Skip to content

Commit 4de4002

Browse files
committed
raised to 1000 steps for ruby
1 parent e758800 commit 4de4002

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎v4-cokapi/backends/ruby/pg_logger.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
stdout_buffer = StringIO.new
6868

6969
n_steps = 0
70-
MAX_STEPS = 300
70+
#MAX_STEPS = 300
71+
MAX_STEPS = 1000 # on 2016-05-01, I increased the limit from 300 to 1000 for Ruby due to popular user demand! and I also improved the warning message
7172

7273
n_lines_added = nil
7374

@@ -600,7 +601,7 @@ def self.iseq_local_variables iseq
600601
# take the final trace entry & make it into a instruction_limit_reached event
601602
if cur_trace.length > 0
602603
cur_trace[-1]['event'] = 'instruction_limit_reached'
603-
cur_trace[-1]['exception_msg'] = "(stopped after %d steps to prevent possible infinite loop)" % MAX_STEPS
604+
cur_trace[-1]['exception_msg'] = "Stopped after running %d steps. Please shorten your code,\nsince Python Tutor is not designed to handle long-running code." % MAX_STEPS
604605
end
605606
rescue
606607
$stdout = STDOUT

0 commit comments

Comments
 (0)