Plugins/CheckerPlugins/Tabnanny/Tabnanny.py

branch
Py2 comp.
changeset 2680
110ac646a3a0
parent 2525
8b507a9a2d40
child 3057
10516539f238
--- a/Plugins/CheckerPlugins/Tabnanny/Tabnanny.py	Thu May 30 15:33:23 2013 +0200
+++ b/Plugins/CheckerPlugins/Tabnanny/Tabnanny.py	Thu May 30 18:52:46 2013 +0200
@@ -43,7 +43,10 @@
 __version__ = "6_eric"
 
 import tokenize
-import io
+try:
+    import StringIO as io
+except (ImportError):
+    import io    # __IGNORE_WARNING__    
 
 import Utilities
 
@@ -111,11 +114,9 @@
     if not text:
         try:
             text = Utilities.readEncodedFile(file)[0]
+            text = Utilities.normalizeCode(text)
         except (UnicodeError, IOError) as msg:
             return (True, file, "1", "Error: {0}".format(str(msg)))
-            
-        # convert eols
-        text = Utilities.convertLineEnds(text, "\n")
     
     source = io.StringIO(text)
     try:

eric ide

mercurial