forked from VimPlug/jedi
A few Python 2 fixes
This commit is contained in:
@@ -234,7 +234,7 @@ def _load_from_typeshed(evaluator, actual_context_set, parent_module_context, im
|
||||
def _try_to_load_stub_from_file(evaluator, actual_context_set, path, import_names):
|
||||
try:
|
||||
stub_module_node = _load_stub(evaluator, path)
|
||||
except OSError:
|
||||
except (OSError, IOError): # IOError is Python 2 only
|
||||
# The file that you're looking for doesn't exist (anymore).
|
||||
return None
|
||||
else:
|
||||
|
||||
@@ -180,6 +180,10 @@ def eval_atom(context, atom):
|
||||
might be a name or a literal as well.
|
||||
"""
|
||||
if atom.type == 'name':
|
||||
if atom.value in ('True', 'False', 'None'):
|
||||
# Python 2...
|
||||
return ContextSet([compiled.builtin_from_name(context.evaluator, atom.value)])
|
||||
|
||||
# This is the first global lookup.
|
||||
stmt = tree.search_ancestor(
|
||||
atom, 'expr_stmt', 'lambdef'
|
||||
|
||||
Reference in New Issue
Block a user