summaryrefslogtreecommitdiffstats
path: root/Tools/idle/PyShell.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/idle/PyShell.py')
-rw-r--r--Tools/idle/PyShell.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py
index 4cabc3e..a794def 100644
--- a/Tools/idle/PyShell.py
+++ b/Tools/idle/PyShell.py
@@ -252,19 +252,27 @@ class PyShell(PyShellEditorWindow):
return "break"
db = self.interp.getdebugger()
if db:
+ self.close_debugger()
+ else:
+ self.open_debugger()
+
+ def close_debugger(self):
+ db = self.interp.getdebugger()
+ if db:
+ self.interp.setdebugger(None)
db.close()
self.resetoutput()
self.console.write("[DEBUG OFF]\n")
sys.ps1 = ">>> "
self.showprompt()
- self.interp.setdebugger(None)
- else:
- import Debugger
- self.interp.setdebugger(Debugger.Debugger(self))
- sys.ps1 = "[DEBUG ON]>>> "
- self.showprompt()
- self.top.tkraise()
- self.text.focus_set()
+
+ def open_debugger(self):
+ import Debugger
+ self.interp.setdebugger(Debugger.Debugger(self))
+ sys.ps1 = "[DEBUG ON]>>> "
+ self.showprompt()
+ self.top.tkraise()
+ self.text.focus_set()
def beginexecuting(self):
# Helper for ModifiedInterpreter