mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-02 14:44:21 +00:00
Fix some deprecation warnings and imports
This commit is contained in:
parent
2399850e4e
commit
d542666f20
@ -31,9 +31,9 @@ import subprocess
|
|||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info > (2, 6):
|
try:
|
||||||
import json
|
import json
|
||||||
else:
|
except ImportError:
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
@ -25,10 +25,11 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info > (2, 6):
|
try:
|
||||||
from hashlib import sha1 as sha
|
from hashlib import sha1 as sha
|
||||||
else:
|
except ImportError:
|
||||||
from sha import sha
|
from sha import sha
|
||||||
|
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
from deluge import bencode
|
from deluge import bencode
|
||||||
|
@ -241,7 +241,7 @@ class FilterTreeView(component.Component):
|
|||||||
try: #assume we could get trashed images here..
|
try: #assume we could get trashed images here..
|
||||||
pix = gtk.gdk.pixbuf_new_from_file_at_size(filename, 16, 16)
|
pix = gtk.gdk.pixbuf_new_from_file_at_size(filename, 16, 16)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.debug(e.message)
|
log.debug(e)
|
||||||
|
|
||||||
if not pix:
|
if not pix:
|
||||||
pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16)
|
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:
|
if not data:
|
||||||
raise Exception("No data")
|
raise Exception("No data")
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.debug("%s %s %s" % (url, e, e.message))
|
log.debug("%s %s" % (url, e))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user