From 47bb8fa27b0636f77062c1c1d3ba338e31c14b5b Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Fri, 27 Oct 2017 15:45:20 +0800 Subject: bugfix: E722 do not use bare except new added pep8 check: https://build.opnfv.org/ci/job/testapi-verify-master/435/console Change-Id: I29c1ffbb534babf55ec2fe675001cc85b9e2e922 Signed-off-by: SerenaFeng --- utils/test/testapi/opnfv_testapi/common/config.py | 2 +- utils/test/testapi/opnfv_testapi/resources/models.py | 4 ++-- utils/test/testapi/opnfv_testapi/resources/result_handlers.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'utils') diff --git a/utils/test/testapi/opnfv_testapi/common/config.py b/utils/test/testapi/opnfv_testapi/common/config.py index 140e49283..f888b07be 100644 --- a/utils/test/testapi/opnfv_testapi/common/config.py +++ b/utils/test/testapi/opnfv_testapi/common/config.py @@ -44,7 +44,7 @@ class Config(object): def _parse_value(value): try: value = int(value) - except: + except Exception: if str(value).lower() == 'true': value = True elif str(value).lower() == 'false': diff --git a/utils/test/testapi/opnfv_testapi/resources/models.py b/utils/test/testapi/opnfv_testapi/resources/models.py index e70a6ed23..27396d116 100644 --- a/utils/test/testapi/opnfv_testapi/resources/models.py +++ b/utils/test/testapi/opnfv_testapi/resources/models.py @@ -91,10 +91,10 @@ class ModelBase(object): elif isinstance(obj, unicode): try: obj = self._obj_format(ast.literal_eval(obj)) - except: + except Exception: try: obj = str(obj) - except: + except Exception: obj = obj elif isinstance(obj, list): hs = list() diff --git a/utils/test/testapi/opnfv_testapi/resources/result_handlers.py b/utils/test/testapi/opnfv_testapi/resources/result_handlers.py index a25852856..4cd533c4b 100644 --- a/utils/test/testapi/opnfv_testapi/resources/result_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/result_handlers.py @@ -33,7 +33,7 @@ class GenericResultHandler(handlers.GenericApiHandler): def get_int(self, key, value): try: value = int(value) - except: + except Exception: raises.BadRequest(message.must_int(key)) return value -- cgit 1.2.3-korg