Plugins/CheckerPlugins/Pep8/pep8.py

branch
5_1_x
changeset 1146
8ddb232355b9
parent 850
8b9f09e7d5d9
child 1510
e75ecf2bd9dd
--- a/Plugins/CheckerPlugins/Pep8/pep8.py	Tue Jun 28 19:23:57 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