diff --git a/thriftpy2/parser/exc.py b/thriftpy2/parser/exc.py index 037bed5..add8305 100644 --- a/thriftpy2/parser/exc.py +++ b/thriftpy2/parser/exc.py @@ -2,6 +2,8 @@ from __future__ import absolute_import +from warnings import warn + class ThriftParserError(Exception): pass @@ -13,3 +15,11 @@ class ThriftLexerError(ThriftParserError): class ThriftGrammarError(ThriftParserError): pass + + +def __getattr__(name): + if name == "ThriftGrammerError": + warn("'ThriftGrammerError' is a typo of 'ThriftGrammarError'", DeprecationWarning) + return ThriftGrammarError + + raise AttributeError("module %r has no attribute %r" % (__name__, name))