Skip to content

Commit

Permalink
Eliminate warnings if a java exception is rescued.
Browse files Browse the repository at this point in the history
  • Loading branch information
quark-zju committed Mar 26, 2013
1 parent 015bf50 commit dada690
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/pry/pry_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ def handle_line(line, options)

result = evaluate_ruby(eval_string)
rescue RescuableException, *jruby_exceptions => e
# Eliminate following warning:
# warning: singleton on non-persistent Java type X
# (http://wiki.jruby.org/Persistence)
if Pry::Helpers::BaseHelpers.jruby? && e.class.respond_to?('__persistent__')
e.class.__persistent__ = true
end
self.last_exception = e
result = e
end
Expand Down

0 comments on commit dada690

Please sign in to comment.