glsa.py: python3: ResourceWarning: unclosed file
authorZac Medico <zmedico@gentoo.org>
Sun, 2 Sep 2012 00:42:11 +0000 (17:42 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 2 Sep 2012 00:42:11 +0000 (17:42 -0700)
pym/portage/glsa.py

index 1857695746773bb308db1e6f743c074e2b8e16ba..f26dc8be28cdc7b7e9812bc31ae162128398482f 100644 (file)
@@ -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):