projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f6ebaf
)
glsa.py: use try/finally for urlopen
author
Zac Medico
<zmedico@gentoo.org>
Wed, 17 Oct 2012 22:57:38 +0000
(15:57 -0700)
committer
Zac Medico
<zmedico@gentoo.org>
Wed, 17 Oct 2012 22:57:38 +0000
(15:57 -0700)
Fixes this error reported with python 2.7.3:
AttributeError: addinfourl instance has no attribute '__exit__'
pym/portage/glsa.py
patch
|
blob
|
history
diff --git
a/pym/portage/glsa.py
b/pym/portage/glsa.py
index f26dc8be28cdc7b7e9812bc31ae162128398482f..d3c3b3da78b68559b776f1df214e806aa0daf913 100644
(file)
--- 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):