accept python2 print syntax in python 3 files
Bug #1541912 reported by
jpinon
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
New
|
Undecided
|
Unassigned |
Bug Description
Using pyflakes 8.1 on this code does not raise error :
import sys
print >>sys.stderr, "Hello"
Launched with :
python3 -m pyflakes hello.py
It's valid syntax in Python 3. >> is the right shift operator, and the comma creates a tuple. If you run the code, you'll see that it raises a TypeError, not a SyntaxError. Unless pyflakes is going to do some basic operator type checking on builtins (could be a good idea?) it's not going to detect this.