mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Make sure the latest changes work with Python 3.6/3.7
This commit is contained in:
@@ -500,7 +500,10 @@ class DirectObjectAccess(object):
|
|||||||
name = m.group(1)
|
name = m.group(1)
|
||||||
|
|
||||||
import typing
|
import typing
|
||||||
|
if sys.version_info >= (3, 8):
|
||||||
args = typing.get_args(self._obj)
|
args = typing.get_args(self._obj)
|
||||||
|
else:
|
||||||
|
args = safe_getattr(self._obj, '__args__', default=None)
|
||||||
return name, tuple(self._create_access_path(arg) for arg in args)
|
return name, tuple(self._create_access_path(arg) for arg in args)
|
||||||
|
|
||||||
def needs_type_completions(self):
|
def needs_type_completions(self):
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ def bar():
|
|||||||
return float
|
return float
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(sys.version_info < (3, 5), reason="Ignore Python 2, because EOL")
|
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Ignore Python 2, because EOL")
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
'annotations, result, code', [
|
'annotations, result, code', [
|
||||||
({}, [], ''),
|
({}, [], ''),
|
||||||
|
|||||||
Reference in New Issue
Block a user