From cdb130ea10aa9f427dae4a103a25a1de1bf79663 Mon Sep 17 00:00:00 2001 From: pichillilorenzo Date: Thu, 29 Mar 2018 17:43:59 +0200 Subject: [PATCH] fixed KeyError: 'test' in show_unused_variables.py --- src/listeners/show_unused_variables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/listeners/show_unused_variables.py b/src/listeners/show_unused_variables.py index 6da4fac..1a7fbfd 100644 --- a/src/listeners/show_unused_variables.py +++ b/src/listeners/show_unused_variables.py @@ -187,7 +187,7 @@ def on_modified_async_with_thread(self, recheck=True): items += [item["alternate"]] if isinstance(item["test"],dict) and "name" in item["test"] and item["test"]["type"] == "Identifier": item = item["test"] - if isinstance(item["test"],dict) and item["test"]["type"] == "UnaryExpression" and "argument" in item["test"] and "name" in item["test"]["argument"] and item["test"]["argument"]["type"] == "Identifier": + elif isinstance(item["test"],dict) and item["test"]["type"] == "UnaryExpression" and "argument" in item["test"] and "name" in item["test"]["argument"] and item["test"]["argument"]["type"] == "Identifier": item = item["test"]["argument"] else: continue