Skip to content

Replace distutils.version with packaging.version since the former was deprecated in python 3.10 and removed in 3.12. #99852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading