On Mon, Dec 20, 2010 at 11:00 PM, Jelmer Vernooij <[email protected]> wrote: > On Mon, 2010-12-20 at 22:53 +0800, Tay Ray Chuan wrote: >> _load_file_contents may return a mmap object, so self._contents could be >> mmap-ed. Close it if so. >> >> Note: we use hasattr() instead of isinstance() for pre-Python 2.6 >> compatibility (mmap became a class in Python 2.6). > Please use getattr() rather than hasattr() as the latter eats > exceptions.
According to the docs, hasattr() wraps around getattr() and "eats" exceptions raised by the latter, returning False if an exception is raised, so it should still be fine. -- Cheers, Ray Chuan _______________________________________________ Mailing list: https://launchpad.net/~dulwich-users Post to : [email protected] Unsubscribe : https://launchpad.net/~dulwich-users More help : https://help.launchpad.net/ListHelp

