slimit icon indicating copy to clipboard operation
slimit copied to clipboard

Consider adding keyword argument `errorlog` to ply lexer

Open dmwyatt opened this issue 9 years ago • 2 comments

ply spews some Warnings to stderr even if you have debug=False.

if you instantiate ply.lex.lex and ply.yacc.yacc with errorlog=ply.lex.NullLogger() you can suppress these warnings.

Optionally make this configurable.

dmwyatt avatar Aug 11 '15 17:08 dmwyatt

Having trouble figuring out how exactly you instantiate these things. Would you mind sharing the code?

Can this be done without recompiling the package? Really like this parser but can't use if it's spitting out all these warnings.

chonigman avatar Oct 14 '15 17:10 chonigman

def quiet(*args, **kwargs):
    pass
from ply import yacc, lex
yacc.PlyLogger.warning = quiet
lex.PlyLogger.warning = quiet

chadawagner avatar Oct 15 '15 20:10 chadawagner