mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-23 01:40:08 +00:00
Fix some deprecation warnings and imports
This commit is contained in:
parent
2399850e4e
commit
d542666f20
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user