diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-07 10:13:35 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-07-07 10:13:35 (GMT) |
commit | 11f0b41e9de3805441ddd4142df9f6b7f4432ca7 (patch) | |
tree | d32d9eadffd3f5a787bafad084d7bd639ec0eff3 /Lib/tokenize.py | |
parent | 9235b254dcad979abe36be1024f8e89b04c764be (diff) | |
download | cpython-11f0b41e9de3805441ddd4142df9f6b7f4432ca7.zip cpython-11f0b41e9de3805441ddd4142df9f6b7f4432ca7.tar.gz cpython-11f0b41e9de3805441ddd4142df9f6b7f4432ca7.tar.bz2 |
Issue #14990: tokenize: correctly fail with SyntaxError on invalid encoding declaration.
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r-- | Lib/tokenize.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py index f283c6d..59081d3 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -310,7 +310,7 @@ def detect_encoding(readline): raise SyntaxError("unknown encoding: " + encoding) if bom_found: - if codec.name != 'utf-8': + if encoding != 'utf-8': # This behaviour mimics the Python interpreter raise SyntaxError('encoding problem: utf-8') encoding += '-sig' |