Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for distutils.version being removed in Python 3.12 (#1165)
Prepare for distutils.version being removed in Python 3.12 SUMMARY distutils has been deprecafed and will be removed from Python's stdlib in Python 3.12 (see https://python.org/dev/peps/pep-0632). This PR replaces the use of distutils.version.LooseVersion and distutils.version.StrictVersion with LooseVersion from the vendored copy of distutils.version included with ansible-core 2.12 (ansible/ansible#74644) if available, and falls back to distutils.version for ansible-core 2.11 and before. Since ansible-core 2.11 and earlier do not support Python 3.12 (since they use LooseVersion itself in various places), this incomplete fix should be OK for now. Also, the way this PR works (by adding a new module_utils version that abstracts away where LooseVersion comes from), it is easy to also fix this for ansible-core 2.11 and earlier later on. Signed-off-by: Abhijeet Kasurde [email protected] ISSUE TYPE Bugfix Pull Request COMPONENT NAME changelogs/fragments/disutils.version.yml plugins/module_utils/version.py plugins/modules/vmware_category.py plugins/modules/vmware_vc_infraprofile_info.py Reviewed-by: Andrew Klychkov <[email protected]> Reviewed-by: Felix Fontein <[email protected]> Reviewed-by: Mario Lenz <[email protected]> Reviewed-by: None <None>
- Loading branch information