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. --- bin/repoman | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'bin/repoman') diff --git a/bin/repoman b/bin/repoman index 1cdfcf674..cfe4b8e01 100755 --- a/bin/repoman +++ b/bin/repoman @@ -25,11 +25,6 @@ import textwrap import time import platform -try: - from urllib.request import urlopen as urllib_request_urlopen -except ImportError: - from urllib import urlopen as urllib_request_urlopen - from itertools import chain from stat import S_ISDIR @@ -75,7 +70,7 @@ from portage.process import find_binary, spawn from portage.output import bold, create_color_func, \ green, nocolor, red from portage.output import ConsoleStyleFile, StyleWriter -from portage.util import cmp_sort_key, writemsg_level +from portage.util import cmp_sort_key, urlopen, writemsg_level from portage.util._desktop_entry import validate_desktop_entry from portage.package.ebuild.digestgen import digestgen from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use @@ -1051,7 +1046,7 @@ def fetch_metadata_dtd(): "needs to be refetched, doing that now") print() try: - url_f = urllib_request_urlopen(metadata_dtd_uri) + url_f = urlopen(metadata_dtd_uri) msg_info = url_f.info() last_modified = msg_info.get('last-modified') if last_modified is not None: -- cgit v1.2.3-1-g7c22