diff --git a/Lib/bdb.py b/Lib/bdb.py index c6a10359ac..ba17f14c03 100644 --- a/Lib/bdb.py +++ b/Lib/bdb.py @@ -89,7 +89,10 @@ class Bdb: if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': - return self.dispatch_return(frame, arg) + res = self.dispatch_return(frame, arg) + if frame == self.botframe: + self.botframe = None + return res if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call':