From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 360EF138010 for ; Wed, 17 Oct 2012 22:58:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E110EE0330; Wed, 17 Oct 2012 22:58:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 652EDE0330 for ; Wed, 17 Oct 2012 22:58:28 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C183333D7F5 for ; Wed, 17 Oct 2012 22:58:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 5CEE2E5436 for ; Wed, 17 Oct 2012 22:58:26 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1350514658.0e5e75ce80bbc9e4dd231c693861fc9b43f677c1.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/glsa.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 0e5e75ce80bbc9e4dd231c693861fc9b43f677c1 X-VCS-Branch: master Date: Wed, 17 Oct 2012 22:58:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e8375a1f-19bf-41b2-ba20-ba862d2174e0 X-Archives-Hash: f78cfc185e789766a010062d3dfeac35 commit: 0e5e75ce80bbc9e4dd231c693861fc9b43f677c1 Author: Zac Medico gentoo org> AuthorDate: Wed Oct 17 22:57:38 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Oct 17 22:57:38 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0e5e75ce 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 files changed, 6 insertions(+), 1 deletions(-) diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py index f26dc8b..d3c3b3d 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):