From bf50970a7fece825a33df2036180c013f2b7dda0 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Wed, 11 Sep 2019 15:24:15 -0700 Subject: [PATCH 1/2] Un-use deprecated method --- .../src/azure_devtools/scenario_tests/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py index 98be0bccebc7..f390b543821b 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py @@ -70,7 +70,7 @@ def trim_kwargs_from_test_function(fn, kwargs): # the next function is the actual test function. the kwargs need to be trimmed so # that parameters which are not required will not be passed to it. if not is_preparer_func(fn): - args, _, kw, _ = inspect.getargspec(fn) # pylint: disable=deprecated-method + args, _, kw, _, _, _, _ = inspect.getfullargspec(fn) if kw is None: args = set(args) for key in [k for k in kwargs if k not in args]: From 60bae707be7e2aa0b0f7176fe4da4fc1ccef49f1 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Wed, 11 Sep 2019 16:02:27 -0700 Subject: [PATCH 2/2] make it python 2 compatible --- .../src/azure_devtools/scenario_tests/utilities.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py index f390b543821b..2959d59c2e46 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py @@ -70,7 +70,10 @@ def trim_kwargs_from_test_function(fn, kwargs): # the next function is the actual test function. the kwargs need to be trimmed so # that parameters which are not required will not be passed to it. if not is_preparer_func(fn): - args, _, kw, _, _, _, _ = inspect.getfullargspec(fn) + try: + args, _, kw, _, _, _, _ = inspect.getfullargspec(fn) + except AttributeError: + args, _, kw, _ = inspect.getargspec(fn) # pylint: disable=deprecated-method if kw is None: args = set(args) for key in [k for k in kwargs if k not in args]: