From 70cb987ad9a7c830fd5640476b9e9dbe1882b9ba Mon Sep 17 00:00:00 2001 From: AN Long Date: Fri, 15 Sep 2023 19:33:10 +0800 Subject: [PATCH] fix typo usage of ThriftGrammerError --- thriftpy2/parser/parser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thriftpy2/parser/parser.py b/thriftpy2/parser/parser.py index e1a03c4..8202ebb 100644 --- a/thriftpy2/parser/parser.py +++ b/thriftpy2/parser/parser.py @@ -13,7 +13,7 @@ import types from ply import lex, yacc from .lexer import * # noqa -from .exc import ThriftParserError, ThriftGrammerError +from .exc import ThriftParserError, ThriftGrammarError from thriftpy2._compat import urlopen, urlparse, PY3 from ..thrift import gen_init, TType, TPayload, TException @@ -23,8 +23,8 @@ def p_error(p): if p is None: - raise ThriftGrammerError('Grammer error at EOF') - raise ThriftGrammerError('Grammer error %r at line %d' % + raise ThriftGrammarError('Grammer error at EOF') + raise ThriftGrammarError('Grammer error %r at line %d' % (p.value, p.lineno)) @@ -869,7 +869,7 @@ def _fill_in_struct(cls, fields, _gen_init=True): for field in fields: if field[0] in thrift_spec or field[3] in _tspec: - raise ThriftGrammerError(('\'%d:%s\' field identifier/name has ' + raise ThriftGrammarError(('\'%d:%s\' field identifier/name has ' 'already been used') % (field[0], field[3])) ttype = field[2]