Update runtime-metadata sanity test for Python 3.10.

This commit is contained in:
Matt Clay 2021-05-06 14:53:50 -07:00
parent 8cccabf1eb
commit 5487e9e4fd
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- ansible-test - Update the ``runtime-metadata`` sanity test to handle a new warning on Python 3.10.

View file

@ -7,6 +7,18 @@ import datetime
import os
import re
import sys
import warnings
# Temporary solution for the PEP 632 deprecation warning on Python 3.10.
# This should be removed once distutils.version has been vendored in ansible.module_utils.
# See: https://github.com/ansible/ansible/issues/74599
# pylint: disable=wrong-import-position
warnings.filterwarnings(
'ignore',
'The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives',
DeprecationWarning,
)
from distutils.version import StrictVersion, LooseVersion
from functools import partial