do safe simplejson import in common and use this imported copy in the 2
other places where its used.
This commit is contained in:
parent
8c2b735a8b
commit
70a810b531
|
@ -29,6 +29,12 @@ import os
|
|||
import time
|
||||
import subprocess
|
||||
import platform
|
||||
import sys
|
||||
|
||||
if sys.version_info > (2, 6):
|
||||
import json
|
||||
else:
|
||||
import simplejson as json
|
||||
|
||||
import pkg_resources
|
||||
import xdg, xdg.BaseDirectory
|
||||
|
|
|
@ -30,16 +30,12 @@ Deluge Config Module
|
|||
import cPickle as pickle
|
||||
import shutil
|
||||
import os
|
||||
import sys
|
||||
|
||||
if sys.version_info > (2, 6):
|
||||
import json
|
||||
else:
|
||||
import simplejson as json
|
||||
|
||||
import deluge.common
|
||||
from deluge.log import LOG as log
|
||||
|
||||
json = deluge.common.json
|
||||
|
||||
def prop(func):
|
||||
"""Function decorator for defining property attributes
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import locale
|
||||
import shutil
|
||||
|
@ -34,11 +33,6 @@ import logging
|
|||
import tempfile
|
||||
import pkg_resources
|
||||
|
||||
if sys.version_info > (2, 6):
|
||||
import json
|
||||
else:
|
||||
import simplejson as json
|
||||
|
||||
from twisted.application import service, internet
|
||||
from twisted.internet.defer import Deferred
|
||||
from twisted.web import http, resource, server, static
|
||||
|
@ -52,6 +46,7 @@ from deluge.ui import common as uicommon
|
|||
from deluge.ui.client import client, Client
|
||||
from deluge.ui.tracker_icons import TrackerIcons
|
||||
log = logging.getLogger(__name__)
|
||||
json = common.json
|
||||
|
||||
# Initialize gettext
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue