From 4aec1a4d1ce4b1e226a8cfcb0386918fdbd3a046 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Tue, 27 Aug 2019 18:11:29 -0700 Subject: [PATCH] Get rid of deprecated warning on py3 while retaining py2.7 compat. --- flytekit/common/tasks/sdk_runnable.py | 5 ++++- flytekit/common/tasks/spark_task.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/flytekit/common/tasks/sdk_runnable.py b/flytekit/common/tasks/sdk_runnable.py index 68fc421ad4c..7f60e9fd853 100644 --- a/flytekit/common/tasks/sdk_runnable.py +++ b/flytekit/common/tasks/sdk_runnable.py @@ -1,6 +1,9 @@ from __future__ import absolute_import -from inspect import getargspec as _getargspec +try: + from inspect import getfullargspec as _getargspec +except ImportError: + from inspect import getargspec as _getargspec import six as _six diff --git a/flytekit/common/tasks/spark_task.py b/flytekit/common/tasks/spark_task.py index f00cff7a992..aab02bdc1cb 100644 --- a/flytekit/common/tasks/spark_task.py +++ b/flytekit/common/tasks/spark_task.py @@ -1,6 +1,9 @@ from __future__ import absolute_import -from inspect import getargspec as _getargspec +try: + from inspect import getfullargspec as _getargspec +except ImportError: + from inspect import getargspec as _getargspec import os as _os import pyspark as _pyspark