From 1db25526445f6d8764708c39315f77be3f2d57c8 Mon Sep 17 00:00:00 2001
From: Massimiliano Culpo <massimiliano.culpo@googlemail.com>
Date: Thu, 22 Sep 2016 09:31:28 +0200
Subject: [PATCH] fix : stops infinite recursion for python 2.6 (#1823)

---
 lib/spack/spack/spec.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 158d76e568..c92594da72 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -531,8 +531,9 @@ def __getattr__(self, item):
         """Delegate to self.package if the attribute is not in the spec"""
         # This line is to avoid infinite recursion in case package is
         # not present among self attributes
-        package = super(Spec, self).__getattribute__('package')
-        return getattr(package, item)
+        if item.endswith('libs'):
+            return getattr(self.package, item)
+        raise AttributeError()
 
     def get_dependency(self, name):
         dep = self._dependencies.get(name)
-- 
GitLab