From 6c5f977d943745f1eaa47da89e32b6c8cd49f41c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 9 Jun 2011 08:43:40 -0700 Subject: lockfile: use hasattr() instead of dir() --- pym/portage/locks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pym/portage/locks.py') diff --git a/pym/portage/locks.py b/pym/portage/locks.py index 50a920061..9ed1d6a6c 100644 --- a/pym/portage/locks.py +++ b/pym/portage/locks.py @@ -114,7 +114,7 @@ def lockfile(mypath, wantnewlockfile=0, unlinkfile=0, try: locking_method(myfd, fcntl.LOCK_EX|fcntl.LOCK_NB) except IOError as e: - if "errno" not in dir(e): + if not hasattr(e, "errno"): raise if e.errno in (errno.EACCES, errno.EAGAIN): # resource temp unavailable; eg, someone beat us to the lock. -- cgit v1.2.3-1-g7c22