Better handling of `__main__.__file__` for debugger.Pdb
Aperta
- Lingua principale
- Python
- Stelle
- 16.8k
- Fork
- 4.5k
- Merge medio
- 1g 2h
- PR unite (30g)
- 6
Descrizione
Related to #2460, the following code causes python to lose access to the `__main__` module's `__file__` variable, because Pdb internally uses ipapi to launch an interactive shell. It would be nice if in this case, the `__file__` variable was not lost.
``` python
import sys
import IPython.core.debugger
IPython.core.debugger.Pdb()
print sys.modules['__main__'].__file__
```
The use case for me (personally) occurs when trying to use `ultratb` as a traceback/debugger. When `ColorTB()` is initialized, it breaks my `__main__` code's `__file__` variable.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.