summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-10-22 10:37:22 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commit87c87ff767c49ff2c369f26bc91300ee4745a0ca (patch)
treebc8eb6e5a49b01d818a4f808931e0fc024bdf4d6 /lib
parent116f6b30eb7820b5f39e3edf0a94b8f0e2308dc9 (diff)
downloadspack-87c87ff767c49ff2c369f26bc91300ee4745a0ca.tar.gz
spack-87c87ff767c49ff2c369f26bc91300ee4745a0ca.tar.bz2
spack-87c87ff767c49ff2c369f26bc91300ee4745a0ca.tar.xz
spack-87c87ff767c49ff2c369f26bc91300ee4745a0ca.zip
Compute the correct package name for hierarchies that change class names
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 11e64e9061..b8dca6e55a 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -306,6 +306,10 @@ class PackageMeta(
_flush_callbacks('run_before')
_flush_callbacks('run_after')
+ # Reset names for packages that inherit from another
+ # package with a different name
+ attr_dict['_name'] = None
+
return super(PackageMeta, cls).__new__(cls, name, bases, attr_dict)
@staticmethod
@@ -355,7 +359,7 @@ class PackageMeta(
The name of a package is the name of its Python module, without
the containing module names.
"""
- if not hasattr(self, '_name'):
+ if self._name is None:
self._name = self.module.__name__
if '.' in self._name:
self._name = self._name[self._name.rindex('.') + 1:]