Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f56309a

Browse files
[compiler-rt][test] Use packaging.version.Version to compare glibc versions (#142596)
Instead of distutils.LooseVersion. distutils was depracated (https://peps.python.org/pep-0632/) and has been removed in Python 3.12 (https://docs.python.org/3/whatsnew/3.12.html) > Of note, the distutils package has been removed from the standard library. packaging's version is able to handle glibc's major.minor: https://packaging.pypa.io/en/latest/version.html#packaging.version.Version > For these modules or types, use the standards-defined Python Packaging Authority packages specified: > distutils.version — use the packaging package Relates to #54337
1 parent 3a7da9a commit f56309a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler-rt/test/lit.common.cfg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,9 @@ def add_glibc_versions(ver_string):
713713
if config.android:
714714
return
715715

716-
from distutils.version import LooseVersion
716+
from packaging.version import Version
717717

718-
ver = LooseVersion(ver_string)
718+
ver = Version(ver_string)
719719
any_glibc = False
720720
for required in [
721721
"2.19",
@@ -727,7 +727,7 @@ def add_glibc_versions(ver_string):
727727
"2.38",
728728
"2.40",
729729
]:
730-
if ver >= LooseVersion(required):
730+
if ver >= Version(required):
731731
config.available_features.add("glibc-" + required)
732732
any_glibc = True
733733
if any_glibc:

0 commit comments

Comments
 (0)