187 source = Utilities.readEncodedFile(file)[0] |
187 source = Utilities.readEncodedFile(file)[0] |
188 # convert eols |
188 # convert eols |
189 source = Utilities.convertLineEnds(source, "\n") |
189 source = Utilities.convertLineEnds(source, "\n") |
190 except (UnicodeError, IOError) as msg: |
190 except (UnicodeError, IOError) as msg: |
191 self.noResults = False |
191 self.noResults = False |
192 self.__createResultItem(file, "1", 0, |
192 self.__createResultItem( |
|
193 file, "1", 0, |
193 self.trUtf8("Error: {0}").format(str(msg))\ |
194 self.trUtf8("Error: {0}").format(str(msg))\ |
194 .rstrip()[1:-1], "") |
195 .rstrip()[1:-1], "") |
195 progress += 1 |
196 progress += 1 |
196 continue |
197 continue |
197 |
198 |
206 self.__project.isProjectFile(file) and \ |
207 self.__project.isProjectFile(file) and \ |
207 self.__project.getProjectLanguage() in ["Python", |
208 self.__project.getProjectLanguage() in ["Python", |
208 "Python2"]): |
209 "Python2"]): |
209 isPy3 = False |
210 isPy3 = False |
210 nok, fname, line, index, code, error, warnings = \ |
211 nok, fname, line, index, code, error, warnings = \ |
211 Utilities.py2compile(file, |
212 Utilities.py2compile( |
|
213 file, |
212 checkFlakes=Preferences.getFlakes( |
214 checkFlakes=Preferences.getFlakes( |
213 "IncludeInSyntaxCheck")) |
215 "IncludeInSyntaxCheck")) |
214 else: |
216 else: |
215 isPy3 = True |
217 isPy3 = True |
216 nok, fname, line, index, code, error = \ |
218 nok, fname, line, index, code, error = \ |