public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10231 - main/trunk/pym/portage/dbapi
@ 2008-05-08 10:33 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-05-08 10:33 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-05-08 10:33:30 +0000 (Thu, 08 May 2008)
New Revision: 10231

Modified:
   main/trunk/pym/portage/dbapi/vartree.py
Log:
Don't use try/finally to close atomic_ofstream since we don't want to
call close() on this stream if an error occurs.


Modified: main/trunk/pym/portage/dbapi/vartree.py
===================================================================
--- main/trunk/pym/portage/dbapi/vartree.py	2008-05-08 09:29:13 UTC (rev 10230)
+++ main/trunk/pym/portage/dbapi/vartree.py	2008-05-08 10:33:30 UTC (rev 10231)
@@ -2313,24 +2313,22 @@
 			for filename in collisions:
 				del blocker_contents[filename]
 			f = atomic_ofstream(os.path.join(blocker.dbdir, "CONTENTS"))
-			try:
-				for filename in sorted(blocker_contents):
-					entry_data = blocker_contents[filename]
-					entry_type = entry_data[0]
-					relative_filename = filename[destroot_len:]
-					if entry_type == "obj":
-						entry_type, mtime, md5sum = entry_data
-						line = "%s %s %s %s\n" % \
-							(entry_type, relative_filename, md5sum, mtime)
-					elif entry_type == "sym":
-						entry_type, mtime, link = entry_data
-						line = "%s %s -> %s %s\n" % \
-							(entry_type, relative_filename, link, mtime)
-					else: # dir, dev, fif
-						line = "%s %s\n" % (entry_type, relative_filename)
-					f.write(line)
-			finally:
-				f.close()
+			for filename in sorted(blocker_contents):
+				entry_data = blocker_contents[filename]
+				entry_type = entry_data[0]
+				relative_filename = filename[destroot_len:]
+				if entry_type == "obj":
+					entry_type, mtime, md5sum = entry_data
+					line = "%s %s %s %s\n" % \
+						(entry_type, relative_filename, md5sum, mtime)
+				elif entry_type == "sym":
+					entry_type, mtime, link = entry_data
+					line = "%s %s -> %s %s\n" % \
+						(entry_type, relative_filename, link, mtime)
+				else: # dir, dev, fif
+					line = "%s %s\n" % (entry_type, relative_filename)
+				f.write(line)
+			f.close()
 
 		# Due to mtime granularity, mtime checks do not always properly
 		# invalidate vardbapi caches.

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-08 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08 10:33 [gentoo-commits] portage r10231 - main/trunk/pym/portage/dbapi Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox