diff --git a/plugins/module_utils/_apypie.py b/plugins/module_utils/_apypie.py index 238b8b98..a48fd970 100644 --- a/plugins/module_utils/_apypie.py +++ b/plugins/module_utils/_apypie.py @@ -1,10 +1,7 @@ # pylint: disable=ansible-format-automatic-specification,raise-missing-from from __future__ import absolute_import, division, print_function __metaclass__ = type -try: - from typing import Any, Iterable, List, Optional, Set, Tuple, cast # pylint: disable=unused-import # noqa: F401 -except ImportError: - pass +from typing import Any, Iterable, List, Optional, Set, Tuple, cast # pylint: disable=unused-import # noqa: F401 """ diff --git a/vendor.py b/vendor.py index 7f1aeaab..e6128d8c 100644 --- a/vendor.py +++ b/vendor.py @@ -69,5 +69,5 @@ output_lines.extend(buffer_lines) buffer_lines.clear() -typing_lines = ['try:', ' from typing import {} # pylint: disable=unused-import # noqa: F401'.format(', '.join(sorted(typing_imports))), 'except ImportError:', ' pass'] +typing_lines = ['from typing import {} # pylint: disable=unused-import # noqa: F401'.format(', '.join(sorted(typing_imports)))] print("\n".join(header_lines + typing_lines + output_lines))