summaryrefslogtreecommitdiffstats
path: root/deluge/core/torrent.py
diff options
context:
space:
mode:
Diffstat (limited to 'deluge/core/torrent.py')
-rw-r--r--deluge/core/torrent.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py
index f40b58834..b69909cbb 100644
--- a/deluge/core/torrent.py
+++ b/deluge/core/torrent.py
@@ -1212,8 +1212,8 @@ class Torrent(object):
bool: True is successful, otherwise False
"""
try:
- self.handle.connect_peer((peer_ip, peer_port), 0)
- except RuntimeError as ex:
+ self.handle.connect_peer((peer_ip, int(peer_port)), 0)
+ except (RuntimeError, ValueError) as ex:
log.debug('Unable to connect to peer: %s', ex)
return False
return True