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:
parent
20065eabdb
commit
3288f0d09e
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ class PP < PrettyPrint
|
||||||
begin
|
begin
|
||||||
require 'io/console'
|
require 'io/console'
|
||||||
_, width = out.winsize
|
_, width = out.winsize
|
||||||
rescue LoadError, NoMethodError, Errno::ENOTTY, Errno::EINVAL
|
rescue LoadError, NoMethodError, SystemCallError
|
||||||
end
|
end
|
||||||
(width || ENV['COLUMNS']&.to_i&.nonzero? || 80) - 1
|
(width || ENV['COLUMNS']&.to_i&.nonzero? || 80) - 1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue