From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 25B0B1387FD for ; Thu, 11 Sep 2014 04:01:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4BE90E0A5C; Thu, 11 Sep 2014 04:01:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D3F9CE0A4F for ; Thu, 11 Sep 2014 04:01:15 +0000 (UTC) Received: from big_daddy.dol-sen.ca (S010600222de111ff.vc.shawcable.net [96.49.5.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id EA8FD34020A for ; Thu, 11 Sep 2014 04:01:14 +0000 (UTC) From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] [PATCH 1/6] FIXME! Comment out a small code block causing TypeError. Date: Wed, 10 Sep 2014 21:01:03 -0700 Message-Id: <1410408068-3441-2-git-send-email-dolsen@gentoo.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1410408068-3441-1-git-send-email-dolsen@gentoo.org> References: <1410408068-3441-1-git-send-email-dolsen@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: 66d17cd6-4767-4ce5-9f20-fd3f175e58f0 X-Archives-Hash: adf844f354ebc901e8e0b030a16100df This was also short circuiting another large code block. FIXME!!!! This whole class seems overly complicated with TOO MANY nested try:excepts: --- catalyst/lock.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/catalyst/lock.py b/catalyst/lock.py index 78968cb..c90f5b8 100644 --- a/catalyst/lock.py +++ b/catalyst/lock.py @@ -27,11 +27,17 @@ class LockDir: locking_method=fcntl.flock lock_dirs_in_use=[] die_on_failed_lock=True + def __del__(self): + #print "Lock.__del__() 1" self.clean_my_hardlocks() + #print "Lock.__del__() 2" self.delete_lock_from_path_list() + #print "Lock.__del__() 3" if self.islocked(): + #print "Lock.__del__() 4" self.fcntl_unlock() + #print "Lock.__del__() finnished" def __init__(self,lockdir): self.locked=False @@ -179,7 +185,9 @@ class LockDir: unlinkfile = 1 if not os.path.exists(self.lockfile): print "lockfile does not exist '%s'" % self.lockfile + #print "fcntl_unlock() , self.myfd:", self.myfd, type(self.myfd) if (self.myfd != None): + #print "fcntl_unlock() trying to close it " try: os.close(self.myfd) self.myfd=None @@ -193,11 +201,13 @@ class LockDir: unlinkfile = 1 self.locking_method(self.myfd,fcntl.LOCK_UN) except SystemExit, e: - raise + raise e except Exception, e: - os.close(self.myfd) - self.myfd=None - raise IOError, "Failed to unlock file '%s'\n" % self.lockfile + #if self.myfd is not None: + #print "fcntl_unlock() trying to close", self.myfd + #os.close(self.myfd) + #self.myfd=None + #raise IOError, "Failed to unlock file '%s'\n%s" % (self.lockfile, str(e)) try: # This sleep call was added to allow other processes that are # waiting for a lock to be able to grab it before it is deleted. @@ -224,7 +234,7 @@ class LockDir: # if "DEBUG" in self.settings: # print "Unlinked lockfile..." except SystemExit, e: - raise + raise e except Exception, e: # We really don't care... Someone else has the lock. # So it is their problem now. @@ -236,7 +246,7 @@ class LockDir: # open fd closed automatically on them. #if type(lockfilename) == types.StringType: # os.close(myfd) - + #print "fcntl_unlock() trying a last ditch close", self.myfd if (self.myfd != None): os.close(self.myfd) self.myfd=None @@ -421,6 +431,7 @@ class LockDir: pass return results + if __name__ == "__main__": def lock_work(): -- 2.1.0