diff --git a/tests/test_parser.py b/tests/test_parser.py index 1c9d891..0e08a40 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -243,7 +243,7 @@ def test_e_load_fp(): with pytest.raises(ThriftParserError) as excinfo: with open('parser-cases/tutorial.thrift') as thrift_fp: load_fp(thrift_fp, 'tutorial_thrift') - assert ('Unexcepted include statement while loading' + assert ('Unexpected include statement while loading ' 'from file like object.') == str(excinfo.value) diff --git a/thriftpy/parser/parser.py b/thriftpy/parser/parser.py index c3cb2c4..26c6073 100644 --- a/thriftpy/parser/parser.py +++ b/thriftpy/parser/parser.py @@ -49,7 +49,7 @@ def p_include(p): '''include : INCLUDE LITERAL''' thrift = thrift_stack[-1] if thrift.__thrift_file__ is None: - raise ThriftParserError('Unexcepted include statement while loading' + raise ThriftParserError('Unexpected include statement while loading ' 'from file like object.') replace_include_dirs = [os.path.dirname(thrift.__thrift_file__)] \ + include_dirs_ @@ -598,8 +598,8 @@ def parse_fp(source, module_name, lexer=None, parser=None, enable_cache=True): return thrift_cache[module_name] if not hasattr(source, 'read'): - raise ThriftParserError('Except `source` to be a file-like object with' - 'a method named \'read\'') + raise ThriftParserError('Expected `source` to be a file-like object ' + 'with a method named \'read\'') if lexer is None: lexer = lex.lex()