From ae631f05c37b8663d3f622d9a73c90d08d18e031 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 6 Jun 2018 17:22:52 -0400 Subject: [PATCH] fix teardown error --- lbrynet/dht/node.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lbrynet/dht/node.py b/lbrynet/dht/node.py index 39fa63a49..e593b8fcd 100644 --- a/lbrynet/dht/node.py +++ b/lbrynet/dht/node.py @@ -22,7 +22,6 @@ import datastore import protocol from peerfinder import DHTPeerFinder from contact import ContactManager -from distance import Distance from iterativefind import iterativeFind @@ -156,7 +155,7 @@ class Node(MockKademliaHelper): def __del__(self): log.warning("unclean shutdown of the dht node") - if self._listeningPort is not None: + if hasattr(self, "_listeningPort") and self._listeningPort is not None: self._listeningPort.stopListening() @defer.inlineCallbacks