From 61f465a7d6d3ee2560b3a7342b0d613442b3c379 Mon Sep 17 00:00:00 2001 From: David Halter Date: Mon, 1 Oct 2012 00:25:14 +0200 Subject: [PATCH] fixed bugs for os.path.join(). --- jedi/evaluate.py | 8 +++++--- jedi/modules.py | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jedi/evaluate.py b/jedi/evaluate.py index f7508019..590d5175 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -669,8 +669,9 @@ class Execution(Executable): elif var_arg[0] == '*': arrays = follow_call_list([var_arg[1:]]) for array in arrays: - for field in array.get_contents(): - yield None, field + if hasattr(array, 'get_contents'): + for field in array.get_contents(): + yield None, field # **kwargs elif var_arg[0] == '**': arrays = follow_call_list([var_arg[1:]]) @@ -1476,7 +1477,8 @@ def follow_path(path, scope, position=None): if isinstance(current, parsing.Array): # This must be an execution, either () or []. if current.type == parsing.Array.LIST: - result = scope.get_index_types(current) + if hasattr(scope, 'get_index_types'): + result = scope.get_index_types(current) elif current.type not in [parsing.Array.DICT]: # Scope must be a class or func - make an instance or execution. debug.dbg('exe', scope) diff --git a/jedi/modules.py b/jedi/modules.py index 490baaa8..744e4f0c 100644 --- a/jedi/modules.py +++ b/jedi/modules.py @@ -197,7 +197,11 @@ def sys_path_with_modifications(module): debug.warning('sys path detected, but failed to evaluate') return None try: - return os.path.abspath(variables['result']) + res = variables['result'] + if isinstance(res, str): + return os.path.abspath(res) + else: + return None except KeyError: return None