Closed duhaime closed 4 years ago
I don't know what you mean with to pass flake8 tests
. The current master does pass PEP8 tests.
In this case the lines you are changing only get t executed for Python 2 and not for Python 3, I am OK ignoring the flake8
violation of those 2 lines. Something like:
if isinstance(text, unicode): # noqa: F821
translate_map = dict(
(ord(c), unicode(split)) for c in filters # noqa: F821
)
But it is a good point to take in general. Create a PEP8 with Python 3.
I hope you don't mind but I made the changes in https://github.com/keras-team/keras-preprocessing/pull/265 I had to make them because I also introduced the Python3 PEP8 Travis stage check, which made the CI fail.
no worries!
Summary
This PR replaces the
unicode()
type reference and typecasting call (both of which are only available in Python 2) in the text module withsix.u()
which is available in Python 2 and 3.This change prevents flake8 from barking about undefined references when running flake tests in Python 3.
Related Issues
N/A
PR Overview