E:\Projects\etc>python
-
m pdb spam.py
> e:\projects\etc\spam.py(
1
)<module>()
-
>
def
fails(test:
int
=
7
)
-
>
str
:
(Pdb)
continue
Traceback (most recent call last):
File
"E:\ProgramFiles\Python37\lib\pdb.py"
, line
1697
,
in
main
pdb._runscript(mainpyfile)
File
"E:\ProgramFiles\Python37\lib\pdb.py"
, line
1566
,
in
_runscript
self
.run(statement)
File
"E:\ProgramFiles\Python37\lib\bdb.py"
, line
585
,
in
run
exec
(cmd,
globals
,
locals
)
File
"<string>"
, line
1
,
in
<module>
File
"e:\projects\etc\spam.py"
, line
1
,
in
<module>
def
fails(test:
int
=
7
)
-
>
str
:
File
"e:\projects\etc\spam.py"
, line
3
,
in
fails
assert
x
=
=
test
AssertionError
Uncaught exception. Entering post mortem debugging
Running
'cont'
or
'step'
will restart the program
> e:\projects\etc\spam.py(
3
)fails()
-
>
assert
x
=
=
test
(Pdb)
list
1
def
fails(test:
int
=
7
)
-
>
str
:
2
x
=
42
3
-
>
assert
x
=
=
test
4
5
6
if
__name__
=
=
'__main__'
:
7
print
(fails())
[EOF]
(Pdb)
break
2
Breakpoint
1
at e:\projects\etc\spam.py:
2
(Pdb)
continue
Post mortem debugger finished. The spam.py will be restarted
> e:\projects\etc\spam.py(
1
)<module>()
-
>
def
fails(test:
int
=
7
)
-
>
str
:
(Pdb)
continue
> e:\projects\etc\spam.py(
2
)fails()
-
> x
=
42
(Pdb) p x
*
*
*
NameError: name
'x'
is
not
defined
(Pdb) p test
7
(Pdb) !test
=
42
(Pdb) p test
42
(Pdb)
continue
None
The program finished
and
will be restarted
> e:\projects\etc\spam.py(
1
)<module>()
-
>
def
fails(test:
int
=
7
)
-
>
str
:
(Pdb) exit