Plugins/CheckerPlugins/Pep8/pep8.py

changeset 1145
2a16484e65c2
parent 945
8cd4d08fa9f6
child 1509
c0b5e693b0eb
diff -r 6185688709ff -r 2a16484e65c2 Plugins/CheckerPlugins/Pep8/pep8.py
--- a/Plugins/CheckerPlugins/Pep8/pep8.py	Wed Jun 29 08:01:51 2011 +0200
+++ b/Plugins/CheckerPlugins/Pep8/pep8.py	Wed Jun 29 13:51:58 2011 +0200
@@ -367,9 +367,8 @@
     if length > MAX_LINE_LENGTH:
         try:
             # The line could contain multi-byte characters
-            if not hasattr(line, 'decode'):   # Python 3
-                line = line.encode('latin-1')
-            length = len(line.decode('utf-8'))
+            if hasattr(line, 'decode'):   # Python 2 only
+                length = len(line.decode('utf-8'))
         except UnicodeDecodeError:
             pass
     if length > MAX_LINE_LENGTH:

eric ide

mercurial