./utils/cmpcodesize/cmpcodesize/main.py:20:71: E231 missing whitespace after ','
./utils/round-trip-syntax-test:20:20: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
./utils/round-trip-syntax-test:21:16: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
I can't find any uses of round-trip-syntax-test, so I don't know if
this fix is correct.
The `__future__` we relied on is now, where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):
* absolute_import
* print_function
* unicode_literals
* division
These import statements are no-ops and are no longer necessary.
The library `six` provides compatibility between Python 2, and 3. It's no
longer necessary once we migrate of Python 2 completely.
Also remove any custom logic for Python 2 (the ones referenced by
a commentanyways).
https://bugs.swift.org/browse/SR-16025
* [Python3] Fix "undefined symbol 'unicode'" from python_lint
This is a little tricky.
Python 2 "unicode" was renamed to "str" in Python 3.
For Python 2 compatibility, we need to use "unicode" in a couple
of places, but that's not defined on Python 3, which causes
python_lint errors (even if the reference is never actually executed).
To workaround this, when running in Python 3, define "unicode"
as a synonym for "str". This defines the symbol (avoiding the
"undefined symbol" error from python lint) while preserving
the correct functionality on both Python 2 and Python 3.
When we drop Python 2 support (which we should do as soon as
possible), we can drop this workaround and globally replace
"unicode" with "str" to get the right Python 3-only functionality.
Make the `round-trip-syntax-test` tool Python 3 friendly by tweaking the
open modes and using `reduce` from `functools` as it has been removed in
Python 3.
Use python's builtin diff rather than invoking `/usr/bin/diff` which
does not exist on Windows. Decode the content into UTF-8 before
processing it for the diff as the file reading will give us UTF-16
content on Windows.