diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2023-01-11 18:04:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 10:04:20 -0700 |
commit | 07499f235586044fcb59d19d2a66e67d6beff32b (patch) | |
tree | c813cffa00e55f9ccf8492bc8787dbde18aebb57 | |
parent | 781c4823e6013c508f910ffcd21f1aa4c92b61d0 (diff) | |
download | spack-07499f235586044fcb59d19d2a66e67d6beff32b.tar.gz spack-07499f235586044fcb59d19d2a66e67d6beff32b.tar.bz2 spack-07499f235586044fcb59d19d2a66e67d6beff32b.tar.xz spack-07499f235586044fcb59d19d2a66e67d6beff32b.zip |
fix: python tix detection blocks reuse (#34768)
Now that the `tix` variant is conditional, it should also be detected
condititionally, otherwise the spec is invalid and cannot be used during
concretization.
-rw-r--r-- | var/spack/repos/builtin/packages/python/package.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 3d3e955024..654eee6e39 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -298,11 +298,12 @@ class Python(Package): variants += "~pyexpat" # Some variant names do not match module names - try: - python("-c", "import tkinter.tix", error=os.devnull) - variants += "+tix" - except ProcessError: - variants += "~tix" + if "+tkinter" in variants: + try: + python("-c", "import tkinter.tix", error=os.devnull) + variants += "+tix" + except ProcessError: + variants += "~tix" # Some modules are platform-dependent if not is_windows: |