diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-01 13:38:06 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-01 13:38:06 -0500 |
commit | 062fbe6d70dd451ae6ada9fde7b596e4aa8b5c26 (patch) | |
tree | 2a7af916e91f307a1854d2621ed5b22079a52335 /coverage/parser.py | |
parent | 4b51265510020834db47ac6cf9ad5314ff16419f (diff) | |
download | python-coveragepy-062fbe6d70dd451ae6ada9fde7b596e4aa8b5c26.tar.gz |
test_arcs now passes for all Python versions
Diffstat (limited to 'coverage/parser.py')
-rw-r--r-- | coverage/parser.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/coverage/parser.py b/coverage/parser.py index b261892..3348092 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: |