Plugins/CheckerPlugins/Pep8/Pep8Fixer.py

branch
5_1_x
changeset 1030
a58e75911f68
parent 869
6d16246da792
child 1204
398b99016b07
diff -r 4ba98509c2bc -r a58e75911f68 Plugins/CheckerPlugins/Pep8/Pep8Fixer.py
--- a/Plugins/CheckerPlugins/Pep8/Pep8Fixer.py	Thu May 12 19:56:33 2011 +0200
+++ b/Plugins/CheckerPlugins/Pep8/Pep8Fixer.py	Fri May 13 18:25:13 2011 +0200
@@ -113,15 +113,16 @@
         """
         Public method to fix the fixable issues.
         
-        @param line line number of issue (integer or string)
-        @param pos character position of issue (integer or string)
+        @param line line number of issue (integer)
+        @param pos character position of issue (integer)
         @param message message text (string)
         @return flag indicating an applied fix (boolean) and a message for
             the fix (string)
         """
         code = message.split(None, 1)[0].strip()
         
-        if (code in self.__fixCodes or len(self.__fixCodes) == 0) and \
+        if line <= len(self.__source) and \
+           (code in self.__fixCodes or len(self.__fixCodes) == 0) and \
            code in self.__fixes:
             res = self.__fixes[code](code, line, pos)
             if res[0]:

eric ide

mercurial