public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r15216 - main/trunk/pym/repoman
@ 2010-01-29 13:36 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2010-01-29 13:36 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2010-01-29 13:36:11 +0000 (Fri, 29 Jan 2010)
New Revision: 15216

Modified:
   main/trunk/pym/repoman/utilities.py
Log:
Move the DOM unlink call to a finally block.


Modified: main/trunk/pym/repoman/utilities.py
===================================================================
--- main/trunk/pym/repoman/utilities.py	2010-01-28 18:01:56 UTC (rev 15215)
+++ main/trunk/pym/repoman/utilities.py	2010-01-29 13:36:11 UTC (rev 15216)
@@ -124,28 +124,30 @@
 		raise exception.ParseError("metadata.xml: %s" % (e,))
 
 	try:
-		usetag = metadatadom.getElementsByTagName("use")
-		if not usetag:
+
+		try:
+			usetag = metadatadom.getElementsByTagName("use")
+			if not usetag:
+				return uselist
+		except NotFoundErr:
 			return uselist
-	except NotFoundErr:
-		return uselist
 
-	try:
-		flags = usetag[0].getElementsByTagName("flag")
-	except NotFoundErr:
-		raise exception.ParseError("metadata.xml: " + \
-			"Malformed input: missing 'flag' tag(s)")
-
-	for flag in flags:
-		pkg_flag = flag.getAttribute("name")
-		if not pkg_flag:
+		try:
+			flags = usetag[0].getElementsByTagName("flag")
+		except NotFoundErr:
 			raise exception.ParseError("metadata.xml: " + \
-				"Malformed input: missing 'name' attribute for 'flag' tag")
-		uselist.append(pkg_flag)
+				"Malformed input: missing 'flag' tag(s)")
 
-	metadatadom.unlink()
-	return uselist
+		for flag in flags:
+			pkg_flag = flag.getAttribute("name")
+			if not pkg_flag:
+				raise exception.ParseError("metadata.xml: " + \
+					"Malformed input: missing 'name' attribute for 'flag' tag")
+			uselist.append(pkg_flag)
+		return uselist
 
+	finally:
+		metadatadom.unlink()
 
 def FindPackagesToScan(settings, startdir, reposplit):
 	""" Try to find packages that need to be scanned




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

only message in thread, other threads:[~2010-01-29 13:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-29 13:36 [gentoo-commits] portage r15216 - main/trunk/pym/repoman 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