From 57e10bbcb79c3bbd4340c77fa252079e2b22b867 Mon Sep 17 00:00:00 2001 From: Paula Madalina Crismaru Date: Fri, 29 Jul 2016 10:18:48 +0300 Subject: [PATCH] Fixes H201: no 'except:' at least use 'except Exception:' Enabled H201 on tox and changes made in relevant files. Change-Id: I7e1f05d9f90b11ac89b371e66ed9a0010462ad01 --- monasca_persister/repositories/persister.py | 2 +- tox.ini | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/monasca_persister/repositories/persister.py b/monasca_persister/repositories/persister.py index 36051cb4..7eb4eae5 100644 --- a/monasca_persister/repositories/persister.py +++ b/monasca_persister/repositories/persister.py @@ -73,7 +73,7 @@ class Persister(object): if len(self._data_points) >= self._database_batch_size: self._flush() - except: + except Exception: LOG.exception( 'Persister encountered fatal exception processing ' 'messages. ' diff --git a/tox.ini b/tox.ini index d9b5e865..df18f563 100644 --- a/tox.ini +++ b/tox.ini @@ -26,8 +26,7 @@ commands = {posargs} [flake8] max-line-length = 120 # TODO: ignored checks should be enabled in the future -# H201 no 'except:' at least use 'except Exception:' # H405 multi line docstring summary not separated with an empty line # H904 Wrap long lines in parentheses instead of a backslash -ignore = F821,H201,H405,H904,E126,E125,H306,E302,E122 +ignore = F821,H405,H904,E126,E125,H306,E302,E122 exclude=.venv,.git,.tox,dist,*openstack/common*,*egg,build