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

lib/pp.rb (width_for): Ignore all syscall errors

According to nobu, Errno::EBAD is raised on Windows.
This commit is contained in:
Yusuke Endoh 2021-11-30 13:46:08 +09:00
parent 20065eabdb
commit 3288f0d09e

View file

@ -65,7 +65,7 @@ class PP < PrettyPrint
begin
require 'io/console'
_, width = out.winsize
rescue LoadError, NoMethodError, Errno::ENOTTY, Errno::EINVAL
rescue LoadError, NoMethodError, SystemCallError
end
(width || ENV['COLUMNS']&.to_i&.nonzero? || 80) - 1
end