From 49ed3db35236d52c7a2d5a34b65573c2c9644868 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Tue, 19 Aug 2014 14:28:18 +0100 Subject: [PATCH] Replace try statement for LT_TORRENT_STATE_MAP lookup --- deluge/core/torrent.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 213dfd7d3..ff6021430 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -626,10 +626,7 @@ class Torrent(object): elif session_is_paused or status.paused: self.state = "Paused" else: - try: - self.state = LT_TORRENT_STATE_MAP[str(status.state)] - except KeyError: - self.state = str(status.state) + self.state = LT_TORRENT_STATE_MAP.get(str(status.state), str(status.state)) if log.isEnabledFor(logging.DEBUG): log.debug("State from lt was: %s | Session is paused: %s", status.state, session_is_paused)