From d6e221c8058259460cadfe62d5ca1bb0d93822cc Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 1 Jan 2016 13:38:06 -0500 Subject: test_arcs now passes for all Python versions --HG-- branch : ast-branch --- coverage/parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'coverage/parser.py') diff --git a/coverage/parser.py b/coverage/parser.py index b2618921..33480924 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -388,7 +388,12 @@ class AstArcAnalyzer(object): def is_constant_expr(self, node): """Is this a compile-time constant?""" node_name = node.__class__.__name__ - return node_name in ["NameConstant", "Num"] + if node_name in ["NameConstant", "Num"]: + return True + elif node_name == "Name": + if env.PY3 and node.id in ["True", "False", "None"]: + return True + return False # tests to write: # TODO: while EXPR: -- cgit v1.2.1