From 344a03e6b279f72de5aa877c84ad545ededca4a6 Mon Sep 17 00:00:00 2001 From: "Nelson, Karl E" Date: Sun, 23 Jun 2019 14:55:35 -0700 Subject: [PATCH] Fix for EmptyCompiledName --- jedi/evaluate/compiled/context.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jedi/evaluate/compiled/context.py b/jedi/evaluate/compiled/context.py index aa0090b8..50b441fc 100644 --- a/jedi/evaluate/compiled/context.py +++ b/jedi/evaluate/compiled/context.py @@ -281,7 +281,11 @@ class CompiledName(AbstractNameDefinition): @property def api_type(self): - return next(iter(self.infer())).api_type + api = self.infer() + # If we can't find the type, assume it is an instance variable + if not api: + return "instance" + return next(iter(api)).api_type @underscore_memoization def infer(self):