Python Glossary Русский

all Python 3pdbexception

pdb.Restart

running under the debugger

An internal pdb exception: the restart command raises it to run the debugged program again from the start.

Syntax

raise pdb.Restart  # так делает команда restart

Undocumented and caught by pdb itself when the debugger runs as python -m pdb script.py: the restart (or run) command raises Restart, and the main loop starts the script over. It is a direct subclass of Exception, so a broad except Exception in the debugged code can catch it and break the restart.

Examples

import pdb
print(pdb.Restart.__mro__[1].__name__)  # → Exception

See also

Open in the full glossarydocs.python.orgReport an inaccuracy