From 0a9cc38a66ded0cf0e5b534cb24b970fc9c21920 Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Tue, 1 May 2012 21:51:16 +0200 Subject: Bug #413983: Add portage.util.urlopen(), which transparently handles authentication in the way compatible with Python 3. --- pym/portage/glsa.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'pym/portage/glsa.py') diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py index 2df7ec3a7..16f662f0d 100644 --- a/pym/portage/glsa.py +++ b/pym/portage/glsa.py @@ -1,14 +1,10 @@ -# Copyright 2003-2011 Gentoo Foundation +# Copyright 2003-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import absolute_import import io import sys -try: - from urllib.request import urlopen as urllib_request_urlopen -except ImportError: - from urllib import urlopen as urllib_request_urlopen import re import xml.dom.minidom @@ -18,7 +14,7 @@ from portage import _encodings from portage import _unicode_decode from portage import _unicode_encode from portage.versions import pkgsplit, catpkgsplit, pkgcmp, best -from portage.util import grabfile +from portage.util import grabfile, urlopen from portage.const import CACHE_PATH from portage.localization import _ from portage.dep import _slot_separator @@ -476,7 +472,7 @@ class Glsa: myurl = "file://"+self.nr else: myurl = repository + "glsa-%s.xml" % str(self.nr) - self.parse(urllib_request_urlopen(myurl)) + self.parse(urlopen(myurl)) return None def parse(self, myfile): -- cgit v1.2.3-1-g7c22