[ruby/irb] Changed to call Kernel.print

If you call `binding.irb` on a class defined `#print`, it will crash, so call `Kernel.print`.

Fix [Bug #18389] `binding.irb` can fail in some classes that implement `context` and `print` methods.

https://github.com/ruby/irb/commit/d54b271984
This commit is contained in:
manga_osyo 2021-12-06 08:57:56 +09:00 committed by git
parent e714163011
commit b6b2e489f1

View File

@ -235,7 +235,7 @@ module IRB # :nodoc:
alias_method to, from
}
else
print "irb: warn: can't alias #{to} from #{from}.\n"
Kernel.print "irb: warn: can't alias #{to} from #{from}.\n"
end
end