From e7143c16bd7320a005d3d8091dd9b7300ca9fcac Mon Sep 17 00:00:00 2001 From: Kate Case Date: Wed, 24 Aug 2022 09:28:22 -0400 Subject: [PATCH] Drop 2.7 shim (#202) --- changelogs/fragments/use-before.yaml | 3 +++ plugins/action/cli_parse.py | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 changelogs/fragments/use-before.yaml diff --git a/changelogs/fragments/use-before.yaml b/changelogs/fragments/use-before.yaml new file mode 100644 index 0000000..ef8bf91 --- /dev/null +++ b/changelogs/fragments/use-before.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - cli_parse - Fix spurious use-before-assign. diff --git a/plugins/action/cli_parse.py b/plugins/action/cli_parse.py index 4106dd7..3a6a38a 100644 --- a/plugins/action/cli_parse.py +++ b/plugins/action/cli_parse.py @@ -27,13 +27,6 @@ from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_valid from ansible_collections.ansible.utils.plugins.modules.cli_parse import DOCUMENTATION -# python 2.7 compat for FileNotFoundError -try: - FileNotFoundError -except NameError: - FileNotFoundError = IOError - - ARGSPEC_CONDITIONALS = { "argument_spec": {"parser": {"mutually_exclusive": [["command", "template_path"]]}}, "required_one_of": [["command", "text"]],