From: Zac Medico Date: Sun, 2 Sep 2012 00:42:11 +0000 (-0700) Subject: glsa.py: python3: ResourceWarning: unclosed file X-Git-Tag: v2.2.0_alpha124~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=98fbf73ba03a048fca37d409092a14472483b6c0;p=portage.git glsa.py: python3: ResourceWarning: unclosed file --- 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):