diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-05 13:21:16 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-05 13:21:16 -0400 |
commit | 7599c0d495353607155f336c8c7a9850f8ad4f55 (patch) | |
tree | b79f345105791f836d3a6deb73550db44731b15c /coverage/phystokens.py | |
parent | 9c308678f4043a093503df1770caf8bc9d6bec9d (diff) | |
download | python-coveragepy-git-7599c0d495353607155f336c8c7a9850f8ad4f55.tar.gz |
Make everything work on py2.3 again (for the last time).
Diffstat (limited to 'coverage/phystokens.py')
-rw-r--r-- | coverage/phystokens.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/coverage/phystokens.py b/coverage/phystokens.py index 9281a447..2a91882d 100644 --- a/coverage/phystokens.py +++ b/coverage/phystokens.py @@ -177,7 +177,9 @@ def source_encoding(source): raise SyntaxError("unknown encoding: " + encoding) if bom_found: - if codec.name != 'utf-8': + # codecs in 2.3 were raw tuples of functions, assume the best. + codec_name = getattr(codec, 'name', encoding) + if codec_name != 'utf-8': # This behaviour mimics the Python interpreter raise SyntaxError('encoding problem: utf-8') encoding += '-sig' |