Fixed an issue in the PEP-8 fixer.

Fri, 13 May 2011 18:24:37 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 13 May 2011 18:24:37 +0200
changeset 1031
c0f795aa71a7
parent 1029
0fb3d1d26eab
child 1032
f7c2e348f6f3

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	Fri May 13 17:53:54 2011 +0200
+++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.Pep8.Pep8Fixer.html	Fri May 13 18:24:37 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	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