[llvm] Replace distutils.version with looseversion since the former was deprecated in python 3.10 and removed in 3.12. (PR #99549)

Thomas Lively via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 14:54:24 PDT 2024


https://github.com/tlively approved this pull request.

I asked around on an internal LLVM chat and consensus was that this is probably fine to commit, but it would also be ideal to reimplement the logic to avoid the dependency. There was one idea to limit the scope of the import, e.g. 

```
if dwarf_version_string and gdb_version_string:
    if int(dwarf_version_string) >= 5:
        try:
          from looseversion import LooseVersion
        except:
          raise Error("running gdb tests requires the looseversion package")
        if LooseVersion(gdb_version_string) < LooseVersion("10.1"):
```

But I don't want to block this :)

https://github.com/llvm/llvm-project/pull/99549


More information about the llvm-commits mailing list