Merge "updated hacking rules"
This commit is contained in:
commit
513eeb80d7
@ -313,6 +313,9 @@ class HTMLViewer(object):
|
||||
return empty_description, headers
|
||||
try:
|
||||
stats = Stats2(*log_files)
|
||||
except (IOError, ValueError):
|
||||
raise DataLoadFailure(_('Can not load profile data from %s.')
|
||||
% log_files)
|
||||
if not fulldirs:
|
||||
stats.strip_dirs()
|
||||
stats.sort_stats(sort)
|
||||
@ -359,9 +362,6 @@ class HTMLViewer(object):
|
||||
'profilehtml': profile_html,
|
||||
})
|
||||
return content, headers
|
||||
except:
|
||||
raise DataLoadFailure(_('Can not load profile data from %s.')
|
||||
% log_files)
|
||||
|
||||
def download(self, log_files, sort='time', limit=-1, nfl_filter='',
|
||||
output_format='default'):
|
||||
@ -438,7 +438,7 @@ class HTMLViewer(object):
|
||||
file_path = nfls[0]
|
||||
try:
|
||||
lineno = int(nfls[1])
|
||||
except:
|
||||
except (TypeError, ValueError, IndexError):
|
||||
lineno = 0
|
||||
# for security reason, this need to be fixed.
|
||||
if not file_path.endswith('.py'):
|
||||
|
@ -242,7 +242,6 @@ class ProfileMiddleware(object):
|
||||
start_response('500 Internal Server Error', [])
|
||||
return _('Error on render profiling results: %s') % ex
|
||||
else:
|
||||
try:
|
||||
_locals = locals()
|
||||
code = self.unwind and PROFILE_EXEC_EAGER or\
|
||||
PROFILE_EXEC_LAZY
|
||||
@ -250,10 +249,6 @@ class ProfileMiddleware(object):
|
||||
app_iter = _locals['app_iter_']
|
||||
self.dump_checkpoint()
|
||||
return app_iter
|
||||
except:
|
||||
self.logger.exception(_('Error profiling code'))
|
||||
finally:
|
||||
pass
|
||||
|
||||
def renew_profile(self):
|
||||
self.profiler = get_profiler(self.profile_module)
|
||||
|
@ -732,7 +732,7 @@ class ContainerReconciler(Daemon):
|
||||
"""
|
||||
try:
|
||||
self.reconcile()
|
||||
except:
|
||||
except: # noqa
|
||||
self.logger.exception('Unhandled Exception trying to reconcile')
|
||||
self.log_stats(force=True)
|
||||
|
||||
|
@ -99,7 +99,7 @@ class TestRecon(unittest.TestCase):
|
||||
def tearDown(self, *_args, **_kwargs):
|
||||
try:
|
||||
os.remove(self.tmpfile_name)
|
||||
except:
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def test_gen_stats(self):
|
||||
|
5
tox.ini
5
tox.ini
@ -58,10 +58,11 @@ commands = python setup.py build_sphinx
|
||||
# it's not a bug that we aren't using all of hacking
|
||||
# H102 -> apache2 license exists
|
||||
# H103 -> license is apache
|
||||
# H201 -> no bare excepts # add when hacking supports noqa
|
||||
# H201 -> no bare excepts (unless marked with " # noqa")
|
||||
# H231 -> Check for except statements to be Python 3.x compatible
|
||||
# H501 -> don't use locals() for str formatting
|
||||
# H903 -> \n not \r\n
|
||||
ignore = H
|
||||
select = F,E,W,H102,H103,H501,H903,H231
|
||||
select = F,E,W,H102,H103,H201,H231,H501,H903
|
||||
exclude = .venv,.tox,dist,doc,*egg
|
||||
show-source = True
|
||||
|
Loading…
Reference in New Issue
Block a user