Fix broken dep_getusedeps() cache behavior so that it returns the
authorZac Medico <zmedico@gentoo.org>
Sat, 24 May 2008 22:24:58 +0000 (22:24 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 24 May 2008 22:24:58 +0000 (22:24 -0000)
correct type.

svn path=/main/trunk/; revision=10395

pym/portage/dep.py

index fa87a7719d1c8462f22a5c47adc53e883b8aa9d6..3e642b51750b282eef18531a50092efd50a3ade7 100644 (file)
@@ -345,6 +345,7 @@ class _use_dep(object):
                                disabled_flags.append(x[1:])
                        else:
                                enabled_flags.append(x)
+               self.tokens = use
                self.enabled = frozenset(enabled_flags)
                self.disabled = frozenset(disabled_flags)
                self.required = self.enabled.union(self.disabled)
@@ -499,8 +500,8 @@ def dep_getusedeps( depend ):
        @return: List of use flags ( or [] if no flags exist )
        """
        use = getattr(depend, "use", None)
-       if use is not None:
-               return use
+       if use is not None and hasattr(use, "tokens"):
+               return use.tokens
        use_list = []
        open_bracket = depend.find('[')
        # -1 = failure (think c++ string::npos)