1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Avoid NoMethodError's with jruby/pull/436 present

This commit is contained in:
☈king 2012-12-20 08:28:27 -06:00 committed by rking@sharpsaw.org
parent 666f3663e0
commit 81b228f1bf

View file

@ -34,15 +34,10 @@ class Pry::TerminalInfo
end
def self.readline_screen_size
if Pry::Helpers::BaseHelpers.jruby?
begin
Readline.get_screen_size
# https://github.com/jruby/jruby/pull/436
rescue Java::JavaLang::NullPointerException
nil
end
elsif Readline.respond_to?(:get_screen_size)
Readline.get_screen_size
end
Readline.get_screen_size if Readline.respond_to?(:get_screen_size)
rescue Java::JavaLang::NullPointerException
# This rescue won't happen on jrubies later than:
# https://github.com/jruby/jruby/pull/436
nil
end
end