Skip to content

Commit

Permalink
Replace distutils.version with packaging.version since the former was…
Browse files Browse the repository at this point in the history
… deprecated in python 3.10 and removed in 3.12. (llvm#99852)

Attempt to reland llvm#99549, but using packaging.version instead of
looseversion, based on the usage used for LLDB in llvm#93712.
  • Loading branch information
dyung authored Jul 22, 2024
1 parent 9d76231 commit 9374216
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cross-project-tests/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import subprocess
import sys

# TODO: LooseVersion is undocumented; use something else.
from distutils.version import LooseVersion

import lit.formats
import lit.util

Expand Down Expand Up @@ -279,7 +276,11 @@ def get_clang_default_dwarf_version_string(triple):
gdb_version_string = get_gdb_version_string()
if dwarf_version_string and gdb_version_string:
if int(dwarf_version_string) >= 5:
if LooseVersion(gdb_version_string) < LooseVersion("10.1"):
try:
from packaging import version
except:
lit_config.fatal("Running gdb tests requires the packaging package")
if version.parse(gdb_version_string) < version.parse("10.1"):
# Example for llgdb-tests, which use lldb on darwin but gdb elsewhere:
# XFAIL: !system-darwin && gdb-clang-incompatibility
config.available_features.add("gdb-clang-incompatibility")
Expand Down

0 comments on commit 9374216

Please sign in to comment.