From a6870d3775940bfa0cccdfd3284c90370e4654d5 Mon Sep 17 00:00:00 2001 From: codl Date: Sun, 24 Sep 2017 23:54:03 +0200 Subject: [PATCH] codacy --- libforget/img_proxy.py | 2 +- libforget/json.py | 2 -- tasks.py | 2 +- test/test_libbrotli.py | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libforget/img_proxy.py b/libforget/img_proxy.py index c217581..fd4e2ae 100644 --- a/libforget/img_proxy.py +++ b/libforget/img_proxy.py @@ -110,7 +110,7 @@ class ImgProxyCache(object): try: headers = pickle.loads(headers) # nosec - except Exception as e: + except Exception: self.redis.delete(self.key('headers', url)) headers = None diff --git a/libforget/json.py b/libforget/json.py index 881bd21..488581e 100644 --- a/libforget/json.py +++ b/libforget/json.py @@ -1,6 +1,4 @@ from json import dumps -from flask import url_for -from app import imgproxy def account(acc): diff --git a/tasks.py b/tasks.py index ebab89a..e5d9dd5 100644 --- a/tasks.py +++ b/tasks.py @@ -331,7 +331,7 @@ def update_mastodon_instances_popularity(): amount = 0.001 if acct.policy_enabled: amount = 0.01 - for session in acct.sessions: + for _ in acct.sessions: amount += 0.01 instance.bump(amount / instance.popularity) diff --git a/test/test_libbrotli.py b/test/test_libbrotli.py index 2627fc3..3e8663c 100644 --- a/test/test_libbrotli.py +++ b/test/test_libbrotli.py @@ -14,7 +14,7 @@ def app(redisdb): app_.debug = True @app_.route('/') - def hello(): + def hello(): # pylint: disable=W0612 return 'Hello, world!' with app_.app_context(): yield app_ @@ -95,7 +95,7 @@ def test_brotli_dynamic_timeout(app): libforget.brotli.brotli(app, timeout=0.001) @app.route('/hard_to_compress') - def hard_to_compress(): + def hard_to_compress(): # pylint: disable=W0612 return token_urlsafe(2**16) client = app.test_client()