Plugins/CheckerPlugins/Pep8/Pep8Fixer.py

changeset 1031
c0f795aa71a7
parent 945
8cd4d08fa9f6
child 1131
7781e396c903
--- a/Plugins/CheckerPlugins/Pep8/Pep8Fixer.py	Fri May 13 17:53:54 2011 +0200
+++ b/Plugins/CheckerPlugins/Pep8/Pep8Fixer.py	Fri May 13 18:24:37 2011 +0200
@@ -114,15 +114,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