diff options
Diffstat (limited to 'tests/test_examplefiles.py')
-rw-r--r-- | tests/test_examplefiles.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_examplefiles.py b/tests/test_examplefiles.py index ddaa53bf..57d17033 100644 --- a/tests/test_examplefiles.py +++ b/tests/test_examplefiles.py @@ -42,7 +42,10 @@ def test_example_files(): def check_lexer(lx, absfn): text = file(absfn, 'U').read() text = text.strip('\n') + '\n' - text = text.decode('latin1') + try: + text = text.decode('utf-8') + except UnicodeError: + text = text.decode('latin1') ntext = [] for type, val in lx.get_tokens(text): ntext.append(val) |