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

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 15:09:12 PDT 2024


dyung wrote:

> 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 :)

Thanks! I'll look into rewriting it into something similar, I just wanted to make sure this got in before the release branching next week since it is causing us a lot of headaches internally.

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


More information about the llvm-commits mailing list