summaryrefslogtreecommitdiff
path: root/pyflakes/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyflakes/api.py')
-rw-r--r--pyflakes/api.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/pyflakes/api.py b/pyflakes/api.py
index 6cc226b..a2a5896 100644
--- a/pyflakes/api.py
+++ b/pyflakes/api.py
@@ -55,14 +55,7 @@ def check(codeString, filename, reporter=None):
text = None
offset -= 1
- # If there's an encoding problem with the file, the text is None.
- if text is None:
- # Avoid using msg, since for the only known case, it contains a
- # bogus message that claims the encoding the file declared was
- # unknown.
- reporter.unexpectedError(filename, 'problem decoding source')
- else:
- reporter.syntaxError(filename, msg, lineno, offset, text)
+ reporter.syntaxError(filename, msg, lineno, offset, text)
return 1
except Exception:
reporter.unexpectedError(filename, 'problem decoding source')