Skip to content

Commit 5367904

Browse files
authored
Merge pull request #250 from zheng-yongping/fix-PR@249
fix: PR#249 depends on ruby2.6 infinite rage syntax
2 parents 2e397b9 + c38d57d commit 5367904

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/iruby/kernel.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def execute_request(msg)
111111
end
112112

113113
def error_content(e)
114-
backtrace = e.backtrace[0..e.backtrace.rindex{|line| line.start_with?(@backend.eval_path)}]
114+
rindex = e.backtrace.rindex{|line| line.start_with?(@backend.eval_path)} || -1
115+
backtrace = e.backtrace[0..rindex]
115116
{ ename: e.class.to_s,
116117
evalue: e.message,
117118
traceback: ["#{RED}#{e.class}#{RESET}: #{e.message}", *backtrace] }

0 commit comments

Comments
 (0)