run-tests: deal with distutil deprecation
PEP 632 recommend the use of `packaging.version` to replace the deprecated
`distutil.version`. So lets do it.
--- 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'