Save ipython debugging session history (>= 0.11)
- Linguagem predominante
- Python
- Estrelas
- 16.8k
- Forks
- 4.5k
- Merge médio
- 1d 2h
- PRs com merge (30d)
- 6
Descrição
When using code below as a pdb replacement (calling debug() instead of pdb.set_trace()), the commands entered during the debugging session are not saved into history. The "< 0.11" branch works ok.
```
old_excepthook = sys.excepthook
if IPython.__version__ >= '0.11':
from IPython.core.debugger import Pdb
try:
ip = get_ipython()
except NameError:
from IPython.frontend.terminal.embed \
import InteractiveShellEmbed
ip = InteractiveShellEmbed()
colors = ip.colors
else:
from IPython.Debugger import Pdb
from IPython.Shell import IPShell
from IPython import ipapi
ip = ipapi.get()
if ip is None:
IPShell(argv=[''])
ip = ipapi.get()
colors = ip.options.colors
def debug(frame=None):
sys.excepthook = old_excepthook
if frame is None:
frame = sys._getframe().f_back
Pdb(colors).set_trace(frame)
```
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.