summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2015-11-05 14:18:33 +0100
committerVictor Stinner <vstinner@redhat.com>2015-11-05 14:18:33 +0100
commit925efaea8cbefb6e5a36e3524b6457da0880c520 (patch)
tree662c42c6c6496402b3389fc8fee8ba39f2de26e2
parentc86685a3fe0ff0b6f813d90677f67a4faf662791 (diff)
downloadpep8-925efaea8cbefb6e5a36e3524b6457da0880c520.tar.gz
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''.
-rwxr-xr-xpep8.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pep8.py b/pep8.py
index b1916cc..d292341 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."""