mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
lib/pp.rb (Kernel#pp): Fix a race condition
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
faae29f869
commit
4ae87f0ad6
1 changed files with 2 additions and 1 deletions
|
@ -17,13 +17,14 @@ module Kernel
|
||||||
# prints arguments in pretty form.
|
# prints arguments in pretty form.
|
||||||
#
|
#
|
||||||
# pp returns argument(s).
|
# pp returns argument(s).
|
||||||
undef pp if method_defined?(:pp)
|
alias __pp_backup__ pp if method_defined?(:pp)
|
||||||
def pp(*objs)
|
def pp(*objs)
|
||||||
objs.each {|obj|
|
objs.each {|obj|
|
||||||
PP.pp(obj)
|
PP.pp(obj)
|
||||||
}
|
}
|
||||||
objs.size <= 1 ? objs.first : objs
|
objs.size <= 1 ? objs.first : objs
|
||||||
end
|
end
|
||||||
|
undef __pp_backup__ if method_defined?(:__pp_backup__)
|
||||||
module_function :pp
|
module_function :pp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue