mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ext/objspace/lib/objspace/trace.rb: Remove the original Kernel#p
... to disable a "method redefined" warning.
20210514
T050008Z.fail.html.gz
```
1) Failure:
TestObjSpace#test_objspace_trace [/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/test/objspace/test_objspace.rb:621]:
<["objspace/trace is enabled"]> expected but was
<["/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/.ext/common/objspace/trace.rb:29: warning: method redefined; discarding old p",
"objspace/trace is enabled"]>.
```
This commit is contained in:
parent
cf1e1879f1
commit
f691c15792
1 changed files with 1 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
||||||
require 'objspace.so'
|
require 'objspace.so'
|
||||||
|
|
||||||
module Kernel
|
module Kernel
|
||||||
|
remove_method :p
|
||||||
define_method(:p) do |*objs|
|
define_method(:p) do |*objs|
|
||||||
objs.each do |obj|
|
objs.each do |obj|
|
||||||
file = ObjectSpace.allocation_sourcefile(obj)
|
file = ObjectSpace.allocation_sourcefile(obj)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue