New submission from beda pišl <bedap...@gmail.com>:

Consider simple script:
```
for i in range(1):
    import pdb
    pdb.set_trace()

x = y + z
```
After running it and pressing 'c' to continue:

```
test$ python test.py
> /Users/bedrich.pisl/test/test.py(1)<module>()
-> for i in range(1):
(Pdb) c
```
I get error, but with wrong error line
```
Traceback (most recent call last):
  File "/Users/bedrich.pisl/test/test.py", line 1, in <module>
    for i in range(1):
NameError: name 'y' is not defined
```
The error is actually on line 5 not 1.

----------
components: Library (Lib)
messages: 409434
nosy: bedapisl
priority: normal
severity: normal
status: open
title: Wrong error line after using pdb
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46215>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to