From 4ac5d43d58706af57c122f2dcadb851e19391f45 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Fri, 18 Jul 2008 04:10:01 +0000 Subject: [PATCH] replace urllib.urlopen (which was marked as deprecated) with urllib2.urlopen --- deluge/core/core.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/deluge/core/core.py b/deluge/core/core.py index 9643e5ad7..5fb7acad0 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -863,15 +863,16 @@ class Core( # check if we've done this within the last week or never if (now - self.config["info_sent"]) >= (60 * 60 * 24 * 7): import deluge.common - import urllib + from urllib import quote_plus + from urllib2 import urlopen import platform try: url = "http://deluge-torrent.org/stats_get.php?processor=" + \ platform.machine() + "&python=" + platform.python_version() \ + "&deluge=" + deluge.common.get_version() \ + "&os=" + platform.system() \ - + "&plugins=" + urllib.quote_plus(self.config["enabled_plugins"]) - urllib.urlopen(url) + + "&plugins=" + quote_plus(self.config["enabled_plugins"]) + urlopen(url) except IOError, e: log.debug("Network error while trying to send info: %s", e) else: @@ -881,9 +882,9 @@ class Core( def get_new_release(self): log.debug("get_new_release") - import urllib + from urllib2 import urlopen try: - self.new_release = urllib.urlopen( + self.new_release = urlopen( "http://download.deluge-torrent.org/version-1.0").read().strip() except Exception, e: log.debug("Unable to get release info from website: %s", e)