fix minor syntax issues with locking
authorAlec Warner <antarus@gentoo.org>
Tue, 16 Jan 2007 00:49:29 +0000 (00:49 -0000)
committerAlec Warner <antarus@gentoo.org>
Tue, 16 Jan 2007 00:49:29 +0000 (00:49 -0000)
svn path=/main/trunk/; revision=5660

pym/portage_news.py

index f02b7938ffb29aa9ffc4fc610849c1ae97cdbf8d..ea804f31b921d13edf29e4df06b82fcec5ef135c 100644 (file)
@@ -74,13 +74,13 @@ class NewsManager(object):
                del path
                
                path = os.path.join( self.UNREAD_PATH, "news-" + repoid + ".unread" )
-               lockfile( path )
+               unread_lock = lockfile( path )
                unread_file = open( path, "a" )
                for item in updates:
                        unread_file.write( item.path + "\n" )
 
                unread_file.close()
-               unlockfile(path)
+               unlockfile(unread_lock)
                
                # Touch the timestamp file
                f = open(self.TIMESTAMP_PATH, "w")
@@ -98,12 +98,12 @@ class NewsManager(object):
                        self.updateItems( repoid )
 
                unreadfile = os.path.join( self.UNREAD_PATH, "news-"+ repoid +".unread" )
-               lockfile(unreadfile)
+               unread_lock = lockfile(unreadfile)
                if os.path.exists( unreadfile ):
                        unread = open( unreadfile ).readlines()
                        if len(unread):
                                return len(unread)
-               unlockfile(unread)
+               unlockfile(unread_lock)
 
 _installedRE = re.compile("Display-If-Installed:(.*)\n")
 _profileRE = re.compile("Display-If-Profile:(.*)\n")