From 925efaea8cbefb6e5a36e3524b6457da0880c520 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 5 Nov 2015 14:18:33 +0100 Subject: [PATCH] fix BytesWarning on Python 3 On Python 3, when python3 with run with -bb, comparison between bytes and str raises a BytesWarning exception. Test the Python version instead of testing '' == b''. --- pep8.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pep8.py b/pep8.py index b1916cce..d2923411 100755 --- a/pep8.py +++ b/pep8.py @@ -1171,7 +1171,7 @@ def python_3000_backticks(logical_line): ############################################################################## -if '' == ''.encode(): +if sys.version_info < (3,): # Python 2: implicit encoding. def readlines(filename): """Read the source code."""