summaryrefslogtreecommitdiff
path: root/coverage/parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/parser.py')
-rw-r--r--coverage/parser.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index e1f09c2..b73ac68 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -420,7 +420,12 @@ class AstArcAnalyzer(object):
def _line__Dict(self, node):
# Python 3.5 changed how dict literals are made.
if env.PYVERSION >= (3, 5) and node.keys:
- return node.keys[0].lineno
+ if node.keys[0] is not None:
+ return node.keys[0].lineno
+ else:
+ # Unpacked dict literals `{**{'a':1}}` have None as the key,
+ # use the value in that case.
+ return node.values[0].lineno
else:
return node.lineno
@@ -439,7 +444,7 @@ class AstArcAnalyzer(object):
OK_TO_DEFAULT = set([
"Assign", "Assert", "AugAssign", "Delete", "Exec", "Expr", "Global",
- "Import", "ImportFrom", "Pass", "Print",
+ "Import", "ImportFrom", "Nonlocal", "Pass", "Print",
])
def add_arcs(self, node):