Fixed an issue in the PEP-8 fixer. 5_1_x

Fri, 13 May 2011 18:25:13 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 13 May 2011 18:25:13 +0200
branch
5_1_x
changeset 1030
a58e75911f68
parent 1028
4ba98509c2bc
child 1041
6a8f46c8819a

Fixed an issue in the PEP-8 fixer.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Plugins.CheckerPlugins.Pep8.Pep8Fixer.html file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/Pep8/Pep8Fixer.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.Pep8.Pep8Fixer.html	Thu May 12 19:56:33 2011 +0200
+++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.Pep8.Pep8Fixer.html	Fri May 13 18:25:13 2011 +0200
@@ -572,10 +572,10 @@
 </p><dl>
 <dt><i>line</i></dt>
 <dd>
-line number of issue (integer or string)
+line number of issue (integer)
 </dd><dt><i>pos</i></dt>
 <dd>
-character position of issue (integer or string)
+character position of issue (integer)
 </dd><dt><i>message</i></dt>
 <dd>
 message text (string)
--- 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