From 997cd975b436235a697c94fe89d8fc6a50bf0b2f Mon Sep 17 00:00:00 2001 From: John Mair Date: Sat, 11 Aug 2012 10:51:32 +1200 Subject: [PATCH] Break out of REPL loop if binding_stack.empty? Occasionally pry would go into a broken state where the binding_stack would be empty. This commit breaks out of the REPL rather than leaving the user in a broken state. --- lib/pry/pry_instance.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 8c905517..d0e47f50 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -228,6 +228,7 @@ class Pry exception = catch(:raise_up) do break_data = catch(:breakout) do loop do + throw(:breakout) if binding_stack.empty? rep(binding_stack.last) end end