diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-09-07 02:41:01 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-09-07 02:41:01 +0000 |
commit | 78105e61390154172c99b4a426f6a2a75cb0b180 (patch) | |
tree | a051ad7a571defd2bf1b2dcc97cb3afe5af913e2 | |
parent | d8cdec9767e8c5899975acab47b3370555d1a951 (diff) | |
download | portage-78105e61390154172c99b4a426f6a2a75cb0b180.tar.gz portage-78105e61390154172c99b4a426f6a2a75cb0b180.tar.bz2 portage-78105e61390154172c99b4a426f6a2a75cb0b180.zip |
Handle AttributeError instead of using getattr. Thanks to Marat Radchenko
<slonopotamusorama@gmail.com> for reporting.
svn path=/main/trunk/; revision=14209
-rw-r--r-- | pym/_emerge/Task.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py index d218ba360..0cd545500 100644 --- a/pym/_emerge/Task.py +++ b/pym/_emerge/Task.py @@ -7,10 +7,10 @@ class Task(SlotObject): __slots__ = ("_hash_key", "_hash_value") def _get_hash_key(self): - hash_key = getattr(self, "_hash_key", None) - if hash_key is None: + try: + return self._hash_key + except AttributeError: raise NotImplementedError(self) - return hash_key def __eq__(self, other): return self._get_hash_key() == other |