summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-08-06 22:21:10 +0900
committerGitHub <noreply@github.com>2020-08-06 21:21:10 +0800
commitb548784b4a31b49026b69849430a9ec9072ae94a (patch)
tree6975f25aeb7533b4481db55d81aa74212a2fe6b6 /lib
parent9d9ae4a0b0bd487bb41170c834b3fa417e161f23 (diff)
downloadpry-b548784b4a31b49026b69849430a9ec9072ae94a.tar.gz
do not undef =~ unless defined (#2149)
Undefining a nonexistent definition is an error in Ruby. This has not been a problem because there always was `Object#=~` predefined. But we are planning to delete that useless method. This would become an error unless properly guarded.
Diffstat (limited to 'lib')
-rw-r--r--lib/pry/code.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pry/code.rb b/lib/pry/code.rb
index ad38b4f2..1fb206c4 100644
--- a/lib/pry/code.rb
+++ b/lib/pry/code.rb
@@ -339,7 +339,7 @@ class Pry
super
end
end
- undef =~
+ undef =~ if method_defined?(:=~)
# Check whether String responds to missing methods.
def respond_to_missing?(method_name, include_private = false)