1
0
forked from VimPlug/jedi

A few Python 2 fixes

This commit is contained in:
Dave Halter
2019-05-18 01:09:09 +02:00
parent cc68942ec1
commit 4176af337f
6 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -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:
+4
View File
@@ -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'