4221 if Preferences.getEditor("AutoCheckSyntax"): |
4221 if Preferences.getEditor("AutoCheckSyntax"): |
4222 self.clearSyntaxError() |
4222 self.clearSyntaxError() |
4223 self.clearFlakesWarnings() |
4223 self.clearFlakesWarnings() |
4224 if self.isPy3File(): |
4224 if self.isPy3File(): |
4225 syntaxError, _fn, errorline, _code, _error = \ |
4225 syntaxError, _fn, errorline, _code, _error = \ |
4226 Utilities.compile(self.fileName, self.text()) |
4226 Utilities.compile(self.fileName or "(Unnamed)", self.text()) |
4227 if syntaxError: |
4227 if syntaxError: |
4228 self.toggleSyntaxError(int(errorline), True, _error) |
4228 self.toggleSyntaxError(int(errorline), True, _error) |
4229 else: |
4229 else: |
4230 if Preferences.getFlakes("IncludeInSyntaxCheck"): |
4230 if Preferences.getFlakes("IncludeInSyntaxCheck"): |
4231 ignoreStarImportWarnings = \ |
4231 ignoreStarImportWarnings = \ |
4247 if err.text.strip(): |
4247 if err.text.strip(): |
4248 msg = err.text.strip() |
4248 msg = err.text.strip() |
4249 else: |
4249 else: |
4250 msg = err.msg |
4250 msg = err.msg |
4251 self.toggleSyntaxError(err.lineno, True, msg) |
4251 self.toggleSyntaxError(err.lineno, True, msg) |
4252 elif self.isPy2File(): |
4252 elif self.isPy2File() and self.fileName is not None: |
4253 syntaxError, _fn, errorline, _code, _error, warnings = \ |
4253 syntaxError, _fn, errorline, _code, _error, warnings = \ |
4254 Utilities.py2compile( |
4254 Utilities.py2compile( |
4255 self.fileName, |
4255 self.fileName, |
4256 checkFlakes = Preferences.getFlakes("IncludeInSyntaxCheck")) |
4256 checkFlakes = Preferences.getFlakes("IncludeInSyntaxCheck")) |
4257 if syntaxError: |
4257 if syntaxError: |