summaryrefslogtreecommitdiffstats
path: root/pym/portage/glsa.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-09-01 17:42:11 -0700
committerZac Medico <zmedico@gentoo.org>2012-09-01 17:42:11 -0700
commit98fbf73ba03a048fca37d409092a14472483b6c0 (patch)
tree2f67ad3342e0c8f553cab06b6672528834e0d41f /pym/portage/glsa.py
parent0c89363dfe8afd98e67b8916ae8233904026493f (diff)
downloadportage-98fbf73ba03a048fca37d409092a14472483b6c0.tar.gz
portage-98fbf73ba03a048fca37d409092a14472483b6c0.tar.bz2
portage-98fbf73ba03a048fca37d409092a14472483b6c0.zip
glsa.py: python3: ResourceWarning: unclosed file
Diffstat (limited to 'pym/portage/glsa.py')
-rw-r--r--pym/portage/glsa.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py
index 185769574..f26dc8be2 100644
--- a/pym/portage/glsa.py
+++ b/pym/portage/glsa.py
@@ -473,7 +473,8 @@ class Glsa:
myurl = "file://"+self.nr
else:
myurl = repository + "glsa-%s.xml" % str(self.nr)
- self.parse(urllib_request_urlopen(myurl))
+ with urllib_request_urlopen(myurl) as f:
+ self.parse(f)
return None
def parse(self, myfile):