mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Fix remaining Python 3.7 issues to get the tests to pass
This commit is contained in:
@@ -327,7 +327,8 @@ class FunctionExecutionContext(TreeContext):
|
|||||||
# The contravariant doesn't seem to be defined.
|
# The contravariant doesn't seem to be defined.
|
||||||
generics = (yield_contexts.py__class__(), NO_CONTEXTS)
|
generics = (yield_contexts.py__class__(), NO_CONTEXTS)
|
||||||
return ContextSet(
|
return ContextSet(
|
||||||
AnnotatedSubClass(c.stub_context, generics) for c in async_generator_classes
|
# In Python 3.6 AsyncGenerator is still a class.
|
||||||
|
AnnotatedSubClass(getattr(c, 'stub_context', c), generics) for c in async_generator_classes
|
||||||
).execute_annotation()
|
).execute_annotation()
|
||||||
else:
|
else:
|
||||||
if evaluator.environment.version_info < (3, 5):
|
if evaluator.environment.version_info < (3, 5):
|
||||||
@@ -337,7 +338,7 @@ class FunctionExecutionContext(TreeContext):
|
|||||||
# Only the first generic is relevant.
|
# Only the first generic is relevant.
|
||||||
generics = (return_contexts.py__class__(), NO_CONTEXTS, NO_CONTEXTS)
|
generics = (return_contexts.py__class__(), NO_CONTEXTS, NO_CONTEXTS)
|
||||||
return ContextSet(
|
return ContextSet(
|
||||||
AnnotatedSubClass(c.stub_context, generics) for c in async_classes
|
AnnotatedSubClass(getattr(c, 'stub_context', c), generics) for c in async_classes
|
||||||
).execute_annotation()
|
).execute_annotation()
|
||||||
else:
|
else:
|
||||||
if is_generator:
|
if is_generator:
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ b; continue
|
|||||||
b; continu
|
b; continu
|
||||||
|
|
||||||
#? []
|
#? []
|
||||||
c + brea
|
c + pass
|
||||||
|
|
||||||
#? []
|
#? []
|
||||||
a + break
|
a + pass
|
||||||
|
|
||||||
#? ['break']
|
#? ['pass']
|
||||||
b; break
|
b; pass
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# Keywords should not appear everywhere.
|
# Keywords should not appear everywhere.
|
||||||
|
|||||||
Reference in New Issue
Block a user