diff --git a/lib/astunparse/unparser.py b/lib/astunparse/unparser.py index 767412c..15a19b9 100644 --- a/lib/astunparse/unparser.py +++ b/lib/astunparse/unparser.py @@ -642,10 +642,10 @@ def _Compare(self, t): self.dispatch(e) self.write(")") - boolops = {ast.And: 'and', ast.Or: 'or'} + boolops = {'And': 'and', 'Or': 'or'} def _BoolOp(self, t): self.write("(") - s = " %s " % self.boolops[t.op.__class__] + s = " %s " % self.boolops[t.op.__class__.__name__] interleave(lambda: self.write(s), self.dispatch, t.values) self.write(")")