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:
parent
666f3663e0
commit
81b228f1bf
1 changed files with 5 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue