diff --git a/deluge/config.py b/deluge/config.py index f1ed0c1b8..c9b0ed893 100644 --- a/deluge/config.py +++ b/deluge/config.py @@ -33,7 +33,7 @@ """Configuration class used to access/create/modify configuration files.""" -import pickle +import cPickle import deluge.common from deluge.log import LOG as log @@ -71,7 +71,7 @@ class Config: # Un-pickle the file and update the config dictionary log.debug("Opening pickled file for load..") pkl_file = open(filename, "rb") - filedump = pickle.load(pkl_file) + filedump = cPickle.load(pkl_file) self.config.update(filedump) pkl_file.close() except IOError: @@ -91,7 +91,7 @@ class Config: try: log.debug("Opening pickled file for comparison..") pkl_file = open(filename, "rb") - filedump = pickle.load(pkl_file) + filedump = cPickle.load(pkl_file) pkl_file.close() if filedump == self.config: # The config has not changed so lets just return @@ -103,7 +103,7 @@ class Config: try: log.debug("Opening pickled file for save..") pkl_file = open(filename, "wb") - pickle.dump(self.config, pkl_file) + cPickle.dump(self.config, pkl_file) log.debug("Closing pickled file..") pkl_file.close() except IOError: diff --git a/deluge/core/core.py b/deluge/core/core.py index 6e46be79e..fcd152db4 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -31,7 +31,6 @@ # this exception statement from your version. If you delete this exception # statement from all source files in the program, then also delete it here. -import pickle import dbus import dbus.service from dbus.mainloop.glib import DBusGMainLoop diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 5123716ed..3cea9beae 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -33,7 +33,7 @@ """TorrentManager handles Torrent objects""" -import pickle +import cPickle import os.path import os @@ -305,7 +305,7 @@ class TorrentManager: log.debug("Opening torrent state file for load.") state_file = open(deluge.common.get_config_dir("torrents.state"), "rb") - state = pickle.load(state_file) + state = cPickle.load(state_file) state_file.close() except IOError: log.warning("Unable to load state file.") @@ -329,7 +329,7 @@ class TorrentManager: log.debug("Saving torrent state file.") state_file = open(deluge.common.get_config_dir("torrents.state"), "wb") - pickle.dump(state, state_file) + cPickle.dump(state, state_file) state_file.close() except IOError: log.warning("Unable to save state file.") diff --git a/deluge/ui/functions.py b/deluge/ui/functions.py index fb6b5dcfc..e085d7024 100644 --- a/deluge/ui/functions.py +++ b/deluge/ui/functions.py @@ -32,7 +32,6 @@ # statement from all source files in the program, then also delete it here. import os.path -import pickle import dbus from dbus.mainloop.glib import DBusGMainLoop