Bugfix #25: Ambiguity resolver sometimes failed under Python3

This commit is contained in:
Erez Shinan 2017-09-14 01:04:34 +03:00
parent 063c7fbdab
commit 5c02166c3f
1 changed files with 4 additions and 1 deletions

View File

@ -24,7 +24,10 @@ def _compare_rules(rule1, rule2):
def _compare_drv(tree1, tree2):
if not (isinstance(tree1, Tree) and isinstance(tree2, Tree)):
return -compare(tree1, tree2)
try:
return -compare(tree1, tree2)
except TypeError:
return 0
try:
rule1, rule2 = tree1.rule, tree2.rule