Skip to content

Commit

Permalink
don't try/except typing imports anymore
Browse files Browse the repository at this point in the history
Python 2 support is gone
  • Loading branch information
evgeni committed Nov 22, 2024
1 parent a03ea94 commit 6f0e926
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions plugins/module_utils/_apypie.py
Original file line number Diff line number Diff line change
@@ -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


"""
Expand Down
2 changes: 1 addition & 1 deletion vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 6f0e926

Please sign in to comment.