Browse Source

Fix DeprecationWarning in lalr_analysis.py

Under python 3.3+, logging.warn is deprecated.
Use logging.warning instead.

Fixes: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/lark/parsers/lalr_analysis.py:87: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.7.2
Paul Vinciguerra 6 years ago
parent
commit
28e571f1c6
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lark/parsers/lalr_analysis.py

+ 2
- 2
lark/parsers/lalr_analysis.py View File

@@ -112,9 +112,9 @@ class LALR_Analyzer(GrammarAnalyzer):
for k, v in lookahead.items():
if len(v) > 1:
if self.debug:
logging.warn("Shift/reduce conflict for terminal %s: (resolving as shift)", k.name)
logging.warning("Shift/reduce conflict for terminal %s: (resolving as shift)", k.name)
for act, arg in v:
logging.warn(' * %s: %s', act, arg)
logging.warning(' * %s: %s', act, arg)
for x in v:
# XXX resolving shift/reduce into shift, like PLY
# Give a proper warning


Loading…
Cancel
Save