diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-02-09 03:44:58 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-02-09 03:44:58 +0000 |
commit | 1d32856c808e1b52ff762efe24955e4d865293b6 (patch) | |
tree | ff1007e2eaaa69c8a3fa28bffa1492f1197b96c4 | |
parent | dda8ccb00635647226f1012ce52bbe2562393683 (diff) | |
download | portage-1d32856c808e1b52ff762efe24955e4d865293b6.tar.gz portage-1d32856c808e1b52ff762efe24955e4d865293b6.tar.bz2 portage-1d32856c808e1b52ff762efe24955e4d865293b6.zip |
use getattr instead of hasattr for detection of base class destructor (recommended by marienz)
svn path=/main/trunk/; revision=2685
-rw-r--r-- | pym/portage_util.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pym/portage_util.py b/pym/portage_util.py index c796ef0a2..c8d55fcdd 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -527,9 +527,9 @@ class atomic_ofstream(file): if not self.closed: self.abort() # ensure destructor from the base class is called - base_self = super(atomic_ofstream, self) - if hasattr(base_self, "__del__"): - base_self.__del__() + base_destructor = getattr(super(atomic_ofstream, self), '__del__', None) + if base_destructor is not None: + base_destructor() def write_atomic(file_path, content): f = atomic_ofstream(file_path) |