mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-15 18:17:07 +08:00
return None on keywords for BaseDefinition.full_name, fixes #94
This commit is contained in:
@@ -139,6 +139,9 @@ class BaseDefinition(object):
|
||||
"""The path to a certain class/function, see #61."""
|
||||
path = [unicode(p) for p in self.path]
|
||||
# TODO add further checks, the mapping should only occur on stdlib.
|
||||
if not path:
|
||||
return None # for keywords the path is empty
|
||||
|
||||
try:
|
||||
path[0] = self._mapping[path[0]]
|
||||
except KeyError:
|
||||
|
||||
@@ -324,7 +324,7 @@ class TestFeature(Base):
|
||||
== 'os.path.join'
|
||||
# issue #94
|
||||
defs = self.get_def("""import json; json.load(""")
|
||||
defs[0].full_name
|
||||
assert defs[0].full_name is None
|
||||
|
||||
def test_full_name_builtin(self):
|
||||
self.assertEqual(self.complete('type')[0].full_name, 'type')
|
||||
|
||||
Reference in New Issue
Block a user