Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Packaging] Support Python 3.11 #26923

Merged
merged 31 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
edf18bd
Init
bebound Jul 18, 2023
e2852ec
Replace inspect.getargspec
bebound Jul 18, 2023
d0421af
Merge branch 'dev' into python-3.11
bebound Jul 20, 2023
c5dec5a
Fix mock_get_extension
bebound Jul 20, 2023
f91ee23
Fix mock error
bebound Jul 21, 2023
db4341f
Test new knack
bebound Jul 24, 2023
7a0c285
Fix test_parser_error_spellchecker
bebound Jul 24, 2023
265fb6c
Fix test_help_loads
bebound Jul 24, 2023
70a89dc
Fix test_command_index_always_loaded_extension
bebound Jul 25, 2023
f2dc5e7
Fix test_vm_defaults
bebound Jul 25, 2023
890df61
Revert "Test new knack"
bebound Jul 26, 2023
97beb14
Merge remote-tracking branch 'upstream/main' into python-3.11
bebound Aug 1, 2023
ae79bd7
Merge remote-tracking branch 'upstream/dev' into python-3.11
bebound Aug 3, 2023
9532240
Revert "Fix test_vm_defaults"
bebound Aug 3, 2023
5a3d9f2
Merge remote-tracking branch 'upstream/dev' into python-3.11
bebound Aug 3, 2023
957f19b
Use 3.11 in test
bebound Aug 4, 2023
0e92cb2
Fix enum str change in 3.11
bebound Aug 4, 2023
edea742
Merge remote-tracking branch 'upstream/dev' into python-3.11
bebound Aug 4, 2023
7e19a72
Minor fix
bebound Aug 7, 2023
36d8dc4
Use inspect.signature()
bebound Aug 7, 2023
87d3e90
Ignore deprecated-method
bebound Aug 7, 2023
952aac6
Merge remote-tracking branch 'upstream/dev' into python-3.11
bebound Aug 10, 2023
b5fedff
Merge branch 'dev' into python-3.11
bebound Aug 17, 2023
f4cf181
Merge remote-tracking branch 'upstream/dev' into python-3.11
bebound Aug 24, 2023
c8109ff
Rollback to inspect.getfullargspec
bebound Aug 25, 2023
ba4951a
Replace locale.getdefaultlocale with locale.getlocale
bebound Sep 12, 2023
f87722c
Merge commit 'a0b940589ec808e41b379b67286fe6d975ed621f' into python-3.11
bebound Sep 13, 2023
f2baaba
Use 3.10 in CodegenCoverage
bebound Sep 13, 2023
6936dc5
Revert fix mock_get_extension
bebound Sep 13, 2023
8b7a8c3
Use 3.11 in CodegenCoverage
bebound Sep 14, 2023
d0887b9
Merge remote-tracking branch 'upstream/dev' into python-3.11
bebound Sep 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions azure-pipelines-full-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
Expand All @@ -44,8 +44,8 @@ jobs:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
Expand All @@ -63,8 +63,8 @@ jobs:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
Expand Down Expand Up @@ -107,8 +107,8 @@ jobs:
fullTest: true
jobName: 'FullTest'

- job: AutomationFullTestPython310ProfileLatest
displayName: Automation Full Test Python310 Profile Latest
- job: AutomationFullTestPython311ProfileLatest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should drop Python 3.10 tests right away as the bundled Python is still 3.10.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundled Python is also bumped in #26749

displayName: Automation Full Test Python311 Profile Latest
timeoutInMinutes: 9999
strategy:
maxParallel: 8
Expand All @@ -134,7 +134,7 @@ jobs:
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
pythonVersion: '3.10'
pythonVersion: '3.11'
profile: 'latest'
instance_cnt: '8'
instance_idx: '$(Instance_idx)'
Expand All @@ -147,16 +147,16 @@ jobs:
- AutomationTest20190301
- AutomationTest20180301
- AutomationFullTestPython39ProfileLatest
- AutomationFullTestPython310ProfileLatest
- AutomationFullTestPython311ProfileLatest
condition: and(failed(), in(variables['Build.Reason'], 'BatchedCI'))
displayName: Notify CI Errors
pool:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- task: AzureCLI@2
inputs:
azureSubscription: 'Azure CLI'
Expand Down
66 changes: 33 additions & 33 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ jobs:

steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11

- bash: ./scripts/ci/dependency_check.sh
displayName: 'Verify src/azure-cli/requirements.py3.Linux.txt'
Expand All @@ -145,9 +145,9 @@ jobs:

steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11

- bash: ./scripts/ci/dependency_check.sh
displayName: 'Verify src/azure-cli/requirements.py3.Darwin.txt'
Expand All @@ -160,9 +160,9 @@ jobs:

steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11

- task: BatchScript@1
inputs:
Expand All @@ -177,9 +177,9 @@ jobs:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
set -ev
Expand Down Expand Up @@ -349,9 +349,9 @@ jobs:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11


- script: |
Expand Down Expand Up @@ -411,9 +411,9 @@ jobs:
--rm -v $PYPI_FILES:/mnt/pypi python:3.9 \
/bin/bash -c "cd /mnt/pypi && ls && pip install --find-links ./ azure_cli-$CLI_VERSION*whl && az self-test && az --version && sleep 5"

echo "== Testing pip install on Python 3.10 =="
echo "== Testing pip install on Python 3.11 =="
docker run \
--rm -v $PYPI_FILES:/mnt/pypi python:3.10 \
--rm -v $PYPI_FILES:/mnt/pypi python:3.11 \
/bin/bash -c "cd /mnt/pypi && ls && pip install --find-links ./ azure_cli-$CLI_VERSION*whl && az self-test && az --version && sleep 5"

displayName: 'Test pip Install'
Expand All @@ -427,8 +427,8 @@ jobs:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
Expand All @@ -444,8 +444,8 @@ jobs:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
Expand All @@ -464,8 +464,8 @@ jobs:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
Expand All @@ -485,8 +485,8 @@ jobs:
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
Expand Down Expand Up @@ -530,7 +530,7 @@ jobs:
-e CLI_VERSION=$CLI_VERSION \
-e HOMEBREW_UPSTREAM_URL=$HOMEBREW_UPSTREAM_URL \
--name azurecli \
python:3.10 \
python:3.11 \
/mnt/scripts/run.sh

# clean up
Expand Down Expand Up @@ -954,9 +954,9 @@ jobs:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
set -ev
Expand All @@ -970,9 +970,9 @@ jobs:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
set -ev
Expand All @@ -987,8 +987,8 @@ jobs:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
pool:
name: ${{ variables.ubuntu_pool }}
steps:
Expand Down Expand Up @@ -1016,9 +1016,9 @@ jobs:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
set -ev
Expand All @@ -1039,9 +1039,9 @@ jobs:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
set -ev
Expand Down Expand Up @@ -1126,9 +1126,9 @@ jobs:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- task: AzureCLI@2
inputs:
azureSubscription: 'Azure CLI'
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'License :: OSI Approved :: MIT License',
]

Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def _get_azure_cli_properties(self):
lambda: _get_config().get('core', 'output', fallback='unknown'))
set_custom_properties(result, 'EnvironmentVariables', _get_env_string)
set_custom_properties(result, 'Locale',
lambda: '{},{}'.format(locale.getdefaultlocale()[0], locale.getdefaultlocale()[1]))
lambda: '{},{}'.format(locale.getlocale()[0], locale.getlocale()[1]))
set_custom_properties(result, 'StartTime', str(self.start_time))
set_custom_properties(result, 'EndTime', str(self.end_time))
set_custom_properties(result, 'InitTimeElapsed', str(self.init_time_elapsed))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ def _check_index():
loader.load_command_table(["hello", "mod-only"])
_check_index()

with mock.patch("azure.cli.core.__version__", "2.7.0"), mock.patch.object(cli.cloud, "profile", "2019-03-01-hybrid"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails in Python 3.11:

E           AttributeError: <MagicMock id='2148541021584'> does not have the attribute '__version__'

C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\unittest\mock.py:1416: AttributeError

I found a similar issue scikit-hep/pyhf#2143. Switching to mock.patch.object(azure.cli.core, '__version__', "2.7.0") indeed solves this error. This makes me wondering if the import logic with string 'azure.cli.core' has been broken in Python 3.11.

After further debugging mock.py source code, I noticed unittest.mock._patch.getter in Python 3.10 is able to get azure.cli.core module, but unittest.mock._patch.getter in Python 3.11 is not able to do that - it returns a MagicMock. According to https://docs.python.org/3/library/unittest.mock.html#id3:

The only exceptions are magic methods and attributes (those that have leading and trailing double underscores). Mock doesn’t create these but instead raises an AttributeError. This is because the interpreter will often implicitly request these methods, and gets very confused to get a new Mock object when it expects a magic method. If you need magic method support see magic methods.

Git blaming mock.py shows unittest.mock._get_target's logic has been changed to use pkgutil.resolve_name in Python 3.11 (python/cpython#18544), but pkgutil.resolve_name's functionality is broken by

@mock.patch('pkgutil.iter_modules', _mock_iter_modules)

Copy link
Contributor Author

@bebound bebound Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, I have never considered that this error is related to @mock.patch('pkgutil.iter_modules', _mock_iter_modules) .

Copy link
Contributor Author

@bebound bebound Aug 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured this out.

The actual cause is @mock.patch('importlib.import_module', _mock_import_lib).

In 3.10, mock use its own _import(target_name), which uses __import__ and getattr, to get the target object. azure.cli.core is returned.
https://github.com/python/cpython/blob/fc382d3dd08709a9dc5000a691d3a74f7b4a99ac/Lib/unittest/mock.py#L1618

In 3.11, it uses pkgutil.resolve_name(target_name) to get target object, which calls importlib.import_module internally.
However, importlib.import_module is patched and always returns mock.MagicMock(), thus a MagicMock() is returned and it does not have __version__ attribution.
https://github.com/python/cpython/blob/ea77520094085ff86160f64fd4bc4f7e8e4ec0d2/Lib/unittest/mock.py#L1614

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this conversation open as a TODO item. I feel there should be a way to patch pkgutil.resolve_name more elegantly.

with mock.patch.object(cli.cloud, "profile", "2019-03-01-hybrid"):
def update_and_check_index():
loader.load_command_table(["hello", "mod-only"])
self.assertEqual(INDEX[CommandIndex._COMMAND_INDEX_VERSION], "2.7.0")
self.assertEqual(INDEX[CommandIndex._COMMAND_INDEX_VERSION], __version__)
self.assertEqual(INDEX[CommandIndex._COMMAND_INDEX_CLOUD_PROFILE], "2019-03-01-hybrid")
self.assertDictEqual(INDEX[CommandIndex._COMMAND_INDEX], self.expected_command_index)

Expand Down Expand Up @@ -395,6 +395,7 @@ def update_and_check_index():
@mock.patch('azure.cli.core.extension.get_extension_modname', _mock_get_extension_modname)
@mock.patch('azure.cli.core.extension.get_extensions', _mock_get_extensions)
def test_command_index_always_loaded_extensions(self):
import azure
from azure.cli.core import CommandIndex

cli = DummyCli()
Expand All @@ -403,14 +404,14 @@ def test_command_index_always_loaded_extensions(self):
index.invalidate()

# Test azext_always_loaded is loaded when command index is rebuilt
with mock.patch('azure.cli.core.ALWAYS_LOADED_EXTENSIONS', ['azext_always_loaded']):
with mock.patch.object(azure.cli.core,'ALWAYS_LOADED_EXTENSIONS', ['azext_always_loaded']):
loader.load_command_table(["hello", "mod-only"])
self.assertEqual(TestCommandRegistration.test_hook, "FAKE_HANDLER")

TestCommandRegistration.test_hook = []

# Test azext_always_loaded is loaded when command index is used
with mock.patch('azure.cli.core.ALWAYS_LOADED_EXTENSIONS', ['azext_always_loaded']):
with mock.patch.object(azure.cli.core,'ALWAYS_LOADED_EXTENSIONS', ['azext_always_loaded']):
loader.load_command_table(["hello", "mod-only"])
self.assertEqual(TestCommandRegistration.test_hook, "FAKE_HANDLER")

Expand Down
2 changes: 0 additions & 2 deletions src/azure-cli-core/azure/cli/core/tests/test_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def test_help_loads(self):
except SystemExit:
pass
cmd_tbl = cli.invocation.commands_loader.command_table
cli.invocation.parser.load_command_table(cli.invocation.commands_loader)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix

src\azure-cli-core\azure\cli\core\tests\test_help.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src\azure-cli-core\azure\cli\core\parser.py:96: in load_command_table
    command_parser = subparser.add_parser(command_verb,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = _SubParsersAction(option_strings=[], dest='_subcommand', nargs='A...', const=None, default=None, type=None, choices={'...ss=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)}, required=True, help=None, metavar=None)
name = 'check-name'
kwargs = {'_command_source': 'acr', 'cli_help': <azure.cli.core._help.AzCliHelp object at 0x00000124500EA150>, 'conflict_handle....description_loader of <azure.cli.core.commands.command_operation.CommandOperation object at 0x000001245073A150>>, ...}
aliases = ()

    def add_parser(self, name, **kwargs):
        # set prog from the existing prefix
        if kwargs.get('prog') is None:
            kwargs['prog'] = '%s %s' % (self._prog_prefix, name)

        aliases = kwargs.pop('aliases', ())

        if name in self._name_parser_map:
>           raise ArgumentError(self, _('conflicting subparser: %s') % name)
E           argparse.ArgumentError: argument _subcommand: conflicting subparser: check-name

The command table is build in cli.invoke(['-h']). If this line is called again, subparsers are added again, which is not allowed in Python 3.11. See python/cpython#18605

for cmd in cmd_tbl:
try:
cmd_tbl[cmd].loader.command_name = cmd
Expand All @@ -140,7 +139,6 @@ def test_help_loads(self):
cli.register_event(events.EVENT_INVOKER_POST_CMD_TBL_CREATE, register_global_subscription_argument)
cli.register_event(events.EVENT_INVOKER_POST_CMD_TBL_CREATE, register_ids_argument)
cli.raise_event(events.EVENT_INVOKER_CMD_TBL_LOADED, command_table=cmd_tbl)
cli.invocation.parser.load_command_table(cli.invocation.commands_loader)
_store_parsers(cli.invocation.parser, parser_dict)

# TODO: do we want to update this as it doesn't actually load all help.
Expand Down
19 changes: 12 additions & 7 deletions src/azure-cli-core/azure/cli/core/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ def load_command_table(self, args):
@mock.patch('azure.cli.core.extension.get_extension_modname', _mock_extension_modname)
@mock.patch('azure.cli.core.extension.get_extensions', _mock_get_extensions)
def test_parser_error_spellchecker(self):
import logging
import azure
cli = DummyCli()
main_loader = MainCommandsLoader(cli)
cli.loader = main_loader
Expand Down Expand Up @@ -224,8 +226,8 @@ def mock_add_extension(*args, **kwargs):
pass

# run multiple faulty commands and save error logs, as well as close matches
with mock.patch('logging.Logger.error', mock_log_error), \
mock.patch('difflib.get_close_matches', mock_get_close_matches):
with mock.patch.object(logging.Logger, 'error', mock_log_error), \
mock.patch.object(difflib, 'get_close_matches', mock_get_close_matches):
Copy link
Contributor Author

@bebound bebound Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this error which is also caused by https://github.com/Azure/azure-cli/pull/26923/files#r1271877325

self.assertEqual(len(logger_msgs), 5)
E AssertionError: 0 != 5
src\azure-cli-core\azure\cli\core\tests\test_parser.py:245: AssertionError

faulty_cmd_args = [
'test module1 --opt enum_1',
'test extension1 --opt enum_1',
Expand Down Expand Up @@ -256,11 +258,14 @@ def mock_add_extension(*args, **kwargs):
self.assertIn(choice, choices)

# test dynamic extension install
with mock.patch('logging.Logger.error', mock_log_error), \
mock.patch('azure.cli.core.extension.operations.add_extension', mock_add_extension), \
mock.patch('azure.cli.core.extension.dynamic_install._get_extension_command_tree', mock_ext_cmd_tree_load), \
mock.patch('azure.cli.core.extension.dynamic_install._get_extension_use_dynamic_install_config', return_value='yes_without_prompt'), \
mock.patch('azure.cli.core.extension.dynamic_install._get_extension_run_after_dynamic_install_config', return_value=False):
with mock.patch.object(logging.Logger, 'error', mock_log_error), \
mock.patch.object(azure.cli.core.extension.operations, 'add_extension', mock_add_extension), \
mock.patch.object(azure.cli.core.extension.dynamic_install, '_get_extension_command_tree',
mock_ext_cmd_tree_load), \
mock.patch.object(azure.cli.core.extension.dynamic_install, '_get_extension_use_dynamic_install_config',
return_value='yes_without_prompt'), \
mock.patch.object(azure.cli.core.extension.dynamic_install,
'_get_extension_run_after_dynamic_install_config', return_value=False):
with self.assertRaises(SystemExit):
parser.parse_args('test new-ext create --opt enum_2'.split())
self.assertIn("Extension new-ext-name installed. Please rerun your command.", logger_msgs[5])
Expand Down
10 changes: 2 additions & 8 deletions src/azure-cli-core/azure/cli/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,8 @@ def in_cloud_console():

def get_arg_list(op):
import inspect

try:
# only supported in python3 - falling back to argspec if not available
sig = inspect.signature(op)
return sig.parameters
except AttributeError:
sig = inspect.getargspec(op) # pylint: disable=deprecated-method
return sig.args
sig = inspect.signature(op)
return sig.parameters


def is_track2(client_class):
Expand Down
Loading