Code Review
/
releng.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
(from parent 1:
8009054
)
Merge "bugfix: E722 do not use bare except"
author
Serena Feng
<feng.xiaowei@zte.com.cn>
Fri, 27 Oct 2017 08:33:27 +0000
(08:33 +0000)
committer
Gerrit Code Review
<gerrit@opnfv.org>
Fri, 27 Oct 2017 08:33:27 +0000
(08:33 +0000)
utils/test/testapi/opnfv_testapi/common/config.py
patch
|
blob
|
history
utils/test/testapi/opnfv_testapi/resources/models.py
patch
|
blob
|
history
utils/test/testapi/opnfv_testapi/resources/result_handlers.py
patch
|
blob
|
history
diff --git
a/utils/test/testapi/opnfv_testapi/common/config.py
b/utils/test/testapi/opnfv_testapi/common/config.py
index
140e492
..
f888b07
100644
(file)
--- 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
e70a6ed
..
27396d1
100644
(file)
--- 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
a258528
..
4cd533c
100644
(file)
--- 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