# HG changeset patch # User Pierre-Yves David # Date 1663804082 -7200 # Node ID 35bf7f23b84cfcb3f7c18119230fb3556b5beda2 # Parent 59a72267f5ce0ae5e3612a35b6b4c08e11bba46a run-tests: deal with distutil deprecation PEP 632 recommend the use of `packaging.version` to replace the deprecated `distutil.version`. So lets do it. diff -r 59a72267f5ce -r 35bf7f23b84c tests/run-tests.py --- a/tests/run-tests.py Fri Sep 09 12:45:26 2022 -0700 +++ b/tests/run-tests.py Thu Sep 22 01:48:02 2022 +0200 @@ -48,7 +48,7 @@ import collections import contextlib import difflib -import distutils.version as version + import errno import functools import json @@ -72,6 +72,13 @@ import uuid import xml.dom.minidom as minidom +try: + # PEP 632 recommend the use of `packaging.version` to replace the + # deprecated `distutil.version`. So lets do it. + import packaging.version as version +except ImportError: + import distutils.version as version + if sys.version_info < (3, 5, 0): print( '%s is only supported on Python 3.5+, not %s'