Make sure the latest changes work with Python 3.6/3.7

This commit is contained in:
Dave Halter
2020-01-10 15:14:22 +01:00
parent 3ba68b5bc6
commit 4f56ec5daf
2 changed files with 5 additions and 2 deletions

View File

@@ -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):

View File

@@ -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', [
({}, [], ''), ({}, [], ''),