summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-01 00:41:17 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-01 00:41:17 +0000
commit4ae87f0ad60e141a83c8c53ff76298adf1eae8f5 (patch)
tree39389572fa0d4081838483d4caa4a6ddb7a45ac2
parentfaae29f869b803f7c3b0f248e6f6ad50565754e8 (diff)
downloadruby-4ae87f0ad60e141a83c8c53ff76298adf1eae8f5.tar.gz
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
-rw-r--r--lib/pp.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pp.rb b/lib/pp.rb
index 0e737d23f6..9acb02f61e 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -17,13 +17,14 @@ module Kernel
# prints arguments in pretty form.
#
# pp returns argument(s).
- undef pp if method_defined?(:pp)
+ alias __pp_backup__ pp if method_defined?(:pp)
def pp(*objs)
objs.each {|obj|
PP.pp(obj)
}
objs.size <= 1 ? objs.first : objs
end
+ undef __pp_backup__ if method_defined?(:__pp_backup__)
module_function :pp
end