diff --git a/lbrynet/core/HashBlob.py b/lbrynet/core/HashBlob.py index a0e95acfb..b9444f3ff 100644 --- a/lbrynet/core/HashBlob.py +++ b/lbrynet/core/HashBlob.py @@ -341,7 +341,6 @@ class HashBlobCreator(object): else: self.blob_hash = self.hashsum.hexdigest() d = self._close() - if self.blob_hash is not None: d.addCallback(lambda _: self.blob_manager.creator_finished(self)) d.addCallback(lambda _: self.blob_hash) @@ -394,4 +393,4 @@ class TempBlobCreator(HashBlobCreator): return defer.succeed(True) def _write(self, data): - self.data_buffer += data \ No newline at end of file + self.data_buffer += data diff --git a/lbrynet/reflector/client/client.py b/lbrynet/reflector/client/client.py index b72d773d7..a6a369bab 100644 --- a/lbrynet/reflector/client/client.py +++ b/lbrynet/reflector/client/client.py @@ -49,6 +49,7 @@ Client may now send another Client Info Request """ import json import logging + from twisted.protocols.basic import FileSender from twisted.internet.protocol import Protocol, ClientFactory from twisted.internet import defer, error @@ -62,9 +63,7 @@ class IncompleteResponseError(Exception): class EncryptedFileReflectorClient(Protocol): - # Protocol stuff - def connectionMade(self): self.blob_manager = self.factory.blob_manager self.response_buff = '' @@ -79,7 +78,8 @@ class EncryptedFileReflectorClient(Protocol): self.streaming = False d = self.get_blobs_to_send(self.factory.stream_info_manager, self.factory.stream_hash) d.addCallback(lambda _: self.send_handshake()) - d.addErrback(lambda err: log.warning("An error occurred immediately: %s", err.getTraceback())) + d.addErrback( + lambda err: log.warning("An error occurred immediately: %s", err.getTraceback())) def dataReceived(self, data): log.debug('Recieved %s', data) @@ -206,7 +206,8 @@ class EncryptedFileReflectorClient(Protocol): self.next_blob_to_send = blob self.read_handle = read_handle return None - raise ValueError("Couldn't open that blob for some reason. blob_hash: {}".format(blob.blob_hash)) + raise ValueError( + "Couldn't open that blob for some reason. blob_hash: {}".format(blob.blob_hash)) def send_blob_info(self): log.debug("Send blob info for %s", self.next_blob_to_send.blob_hash)