Commit 2bc17135 authored by Sebastien Bourdeauducq's avatar Sebastien Bourdeauducq
Browse files

fix incorrect use of is/==. Closes #199

parent bee558c8
......@@ -83,7 +83,7 @@ class NodeVisitor:
def visit_Case(self, node):
self.visit(node.test)
for v, statements in sorted(node.cases.items(),
key=lambda x: -1 if x[0] is "default" else x[0].duid):
key=lambda x: -1 if x[0] == "default" else x[0].duid):
self.visit(statements)
def visit_Fragment(self, node):
......@@ -188,7 +188,7 @@ class NodeTransformer:
def visit_Case(self, node):
cases = {v: self.visit(statements)
for v, statements in sorted(node.cases.items(),
key=lambda x: -1 if x[0] is "default" else x[0].duid)}
key=lambda x: -1 if x[0] == "default" else x[0].duid)}
r = Case(self.visit(node.test), cases)
return r
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment