From 3f0137a817923b9eea745cf641dfe7a0516e29c4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 15 Feb 2006 18:40:32 +0000 Subject: fix case where myfd == None (regression from revision 2714) svn path=/main/trunk/; revision=2715 --- pym/portage_locks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pym') diff --git a/pym/portage_locks.py b/pym/portage_locks.py index 7a9b55674..f108cba2e 100644 --- a/pym/portage_locks.py +++ b/pym/portage_locks.py @@ -147,9 +147,11 @@ def unlockfile(mytuple): unhardlink_lockfile(lockfilename) return True - if type(lockfilename) == types.StringType and os.fstat(myfd).st_nlink != 1: + # myfd may be None here due to myfd = mypath in lockfile() + if type(lockfilename) == types.StringType and not os.path.exists(lockfilename): portage_util.writemsg("lockfile does not exist '%s'\n" % lockfilename,1) - os.close(myfd) + if myfd is not None: + os.close(myfd) return False try: -- cgit v1.2.3-1-g7c22