From 9f9bbaae56a473d4805c863f3a27aa833db4d6ba Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 4 Jan 2013 20:16:13 +0100 Subject: [PATCH] no str cast on None for module paths --- jedi/api_classes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jedi/api_classes.py b/jedi/api_classes.py index 633cf259..03ae63d9 100644 --- a/jedi/api_classes.py +++ b/jedi/api_classes.py @@ -57,7 +57,8 @@ class BaseDefinition(object): self.is_keyword = isinstance(definition, keywords.Keyword) # generate a path to the definition - self.module_path = unicode(definition.get_parent_until().path) + p = definition.get_parent_until().path + self.module_path = p if p is None else unicode(p) @property def type(self): @@ -92,7 +93,8 @@ class BaseDefinition(object): def in_builtin_module(self): """Whether this is a builtin module.""" - return not self.module_path.endswith('.py') + return not (self.module_path is None or + self.module_path.endswith('.py')) @property def line_nr(self):