#2503 make singletons compared with "is" not == or !=
Thanks to Wummel for the patch
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 03dd5b5..e4f87f2 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -130,7 +130,7 @@
def test_order(ast_node, parent_pos):
- if not isinstance(ast_node, _ast.AST) or ast_node._fields == None:
+ if not isinstance(ast_node, _ast.AST) or ast_node._fields is None:
return
if isinstance(ast_node, (_ast.expr, _ast.stmt, _ast.excepthandler)):
node_pos = (ast_node.lineno, ast_node.col_offset)
@@ -141,7 +141,7 @@
if isinstance(value, list):
for child in value:
test_order(child, parent_pos)
- elif value != None:
+ elif value is not None:
test_order(value, parent_pos)
def run_tests():