From 0e5e75ce80bbc9e4dd231c693861fc9b43f677c1 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 17 Oct 2012 15:57:38 -0700 Subject: glsa.py: use try/finally for urlopen Fixes this error reported with python 2.7.3: AttributeError: addinfourl instance has no attribute '__exit__' --- pym/portage/glsa.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pym/portage/glsa.py') diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py index f26dc8be2..d3c3b3da7 100644 --- a/pym/portage/glsa.py +++ b/pym/portage/glsa.py @@ -473,8 +473,13 @@ class Glsa: myurl = "file://"+self.nr else: myurl = repository + "glsa-%s.xml" % str(self.nr) - with urllib_request_urlopen(myurl) as f: + + f = urllib_request_urlopen(myurl) + try: self.parse(f) + finally: + f.close() + return None def parse(self, myfile): -- cgit v1.2.3-1-g7c22