From: Zac Medico Date: Wed, 15 Feb 2006 18:40:32 +0000 (-0000) Subject: fix case where myfd == None (regression from revision 2714) X-Git-Tag: v2.1_pre5_2760~41 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3f0137a817923b9eea745cf641dfe7a0516e29c4;p=portage.git fix case where myfd == None (regression from revision 2714) svn path=/main/trunk/; revision=2715 --- 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: