I have the following Python code to write dependency files of a project. It works fine with Python 2.x, but while testing it with Python 3 it reports an error.
Note that starting in Python 3.6.3 (September 2017), the error message for this case will be changing to recommend the Python 3 spelling:
>>> print >> sys.stderr
Traceback (most recent call last):
File "", line 1, in
TypeError: unsupported operand type(s) for >>:
'builtin_function_or_method' and '_io.TextIOWrapper'.
Did you mean "print(, file=)"?
(Explicit line breaks added to avoid side-scrolling - the actual error message just wraps at the width of your terminal window)