STINNER Victor <victor.stin...@gmail.com> added the comment:

The note in the documentation is wrong: the line number is correct when using 
the -x option, even if the first line is skipped.

Example with Python 2.7:
---
$ cat x.py 
print(1)
print(2)
x

$ python2 x.py 
1
2
Traceback (most recent call last):
  File "x.py", line 3, in <module>
    x
NameError: name 'x' is not defined

$ python2 -x x.py 
2
Traceback (most recent call last):
  File "x.py", line 3, in <module>
    x
NameError: name 'x' is not defined
---

Attached PR 4423 fixes Python 2.7 documentation.

----------

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

Reply via email to