Don't rely on Thread constant [Fixes #629]
This commit is contained in:
parent
be95f6a3eb
commit
1d640ed9ec
|
@ -42,7 +42,7 @@ class Pry
|
|||
if opts.quiet? && (internal_binding? || !code?)
|
||||
return
|
||||
elsif internal_binding?
|
||||
output.puts "Could not find local context, did you use \`binding.pry\`?"
|
||||
output.puts "Insert #{target_self.inspect}"
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ class Pry
|
|||
# @return [Object] The value the local was set to.
|
||||
def inject_local(name, value, b)
|
||||
Thread.current[:__pry_local__] = value.is_a?(Proc) ? value.call : value
|
||||
b.eval("#{name} = Thread.current[:__pry_local__]")
|
||||
b.eval("#{name} = ::Thread.current[:__pry_local__]")
|
||||
ensure
|
||||
Thread.current[:__pry_local__] = nil
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue