Fix some deprecation warnings and imports

This commit is contained in:
Andrew Resch 2009-02-20 14:32:28 +00:00
parent 2399850e4e
commit d542666f20
4 changed files with 8 additions and 7 deletions

View File

@ -30,10 +30,10 @@ import time
import subprocess
import platform
import sys
if sys.version_info > (2, 6):
try:
import json
else:
except ImportError:
import simplejson as json
import pkg_resources

View File

@ -25,10 +25,11 @@
import os
import sys
if sys.version_info > (2, 6):
try:
from hashlib import sha1 as sha
else:
except ImportError:
from sha import sha
import urlparse
from deluge import bencode

View File

@ -241,7 +241,7 @@ class FilterTreeView(component.Component):
try: #assume we could get trashed images here..
pix = gtk.gdk.pixbuf_new_from_file_at_size(filename, 16, 16)
except Exception, e:
log.debug(e.message)
log.debug(e)
if not pix:
pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16)

View File

@ -55,7 +55,7 @@ def fetch_url(url, valid_subtypes=None):
if not data:
raise Exception("No data")
except Exception, e:
log.debug("%s %s %s" % (url, e, e.message))
log.debug("%s %s" % (url, e))
return None
return data