Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py

changeset 6891
93f82da09f22
parent 6645
ad476851d7e0
diff -r 26c1042f2eec -r 93f82da09f22 Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py	Thu Mar 21 19:26:10 2019 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py	Thu Mar 21 19:27:42 2019 +0100
@@ -208,7 +208,7 @@
         
         if not self.__modified:
             # no need to write
-            return
+            return None
         
         if self.__createBackup:
             # create a backup file before writing any changes
@@ -239,7 +239,8 @@
         except (IOError, UnicodeError) as err:
             # Could not save the file! Skipping it. Reason: {0}
             return ("FWRITE_ERROR", (str(err),))
-        return
+        
+        return None
     
     def __codeMatch(self, code):
         """
@@ -1954,6 +1955,8 @@
         """
         if line < len(self.after):
             return self.after[line]
+        
+        return ""
     
     def getline(self):
         """
@@ -2106,7 +2109,7 @@
         # pycodestyle.py:continuation_line_indentation. All of the comments
         # have been stripped and the 'yield' statements replaced with 'pass'.
         if not self.tokens:
-            return
+            return []
 
         first_row = self.tokens[0][2][0]
         nrows = 1 + self.tokens[-1][2][0] - first_row

eric ide

mercurial