From 72a1d891a02b1ea98b27e8c86403ade524a903f1 Mon Sep 17 00:00:00 2001 From: Troy McConaghy Date: Sat, 3 Nov 2018 17:08:52 +0100 Subject: [PATCH] Fixed four Flake8 errors --- bigchaindb/backend/localmongodb/connection.py | 2 +- bigchaindb/upsert_validator/validator_utils.py | 2 +- bigchaindb/web/websocket_server.py | 2 +- tests/conftest.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bigchaindb/backend/localmongodb/connection.py b/bigchaindb/backend/localmongodb/connection.py index ffdb84b6..40142168 100644 --- a/bigchaindb/backend/localmongodb/connection.py +++ b/bigchaindb/backend/localmongodb/connection.py @@ -62,7 +62,7 @@ class LocalMongoDBConnection(Connection): try: try: return query.run(self.conn) - except pymongo.errors.AutoReconnect as exc: + except pymongo.errors.AutoReconnect: logger.warning('Lost connection to the database, ' 'retrying query.') return query.run(self.conn) diff --git a/bigchaindb/upsert_validator/validator_utils.py b/bigchaindb/upsert_validator/validator_utils.py index b0f8a81e..61562261 100644 --- a/bigchaindb/upsert_validator/validator_utils.py +++ b/bigchaindb/upsert_validator/validator_utils.py @@ -57,7 +57,7 @@ def validate_asset_public_key(pk): if len(pk_decoded) != 32: raise InvalidPublicKey('Public key should be of size 32 bytes') - except binascii.Error as e: + except binascii.Error: raise InvalidPublicKey('Invalid `type` specified for public key `value`') diff --git a/bigchaindb/web/websocket_server.py b/bigchaindb/web/websocket_server.py index efe10151..fcf01d0a 100644 --- a/bigchaindb/web/websocket_server.py +++ b/bigchaindb/web/websocket_server.py @@ -134,7 +134,7 @@ def websocket_handler(request): except RuntimeError as e: logger.debug('Websocket exception: %s', str(e)) break - except CancelledError as e: + except CancelledError: logger.debug('Websocket closed') break if msg.type == aiohttp.WSMsgType.CLOSED: diff --git a/tests/conftest.py b/tests/conftest.py index a96d843f..ab798749 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -415,7 +415,7 @@ def abci_http(_setup_database, _configure_bigchaindb, abci_server, requests.get(uri) return True - except requests.exceptions.RequestException as e: + except requests.exceptions.RequestException: pass time.sleep(1)