diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index e5c20da1f..04af0a5da 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -95,13 +95,12 @@ class TorrentOptions(dict): super(TorrentOptions, self).__setitem__(key, value) def __getitem__(self, key): - if super(TorrentOptions, self).has_key(key): + if key in super(TorrentOptions, self): return super(TorrentOptions, self).__getitem__(key) - else: - if key in self.config: + elif key in self.default_keys and self.default_keys[key] in self.config: return self.config[self.default_keys[key]] - else: - return self.default_keys[key] + else: + raise KeyError class Torrent: """Torrent holds information about torrents added to the libtorrent session.