flake8: apply all rest E7 rules

This commit is contained in:
Yuming Zhu 2020-02-26 04:49:48 +08:00
parent 6ed30954b2
commit f1ba6cefd7
24 changed files with 112 additions and 127 deletions

View file

@ -138,7 +138,7 @@ def log_output(session, path, args, outfile, uploadpath, cwd=None, logerror=0, a
if env:
environ.update(env)
os.execvpe(path, args, environ)
except:
except BaseException:
msg = ''.join(traceback.format_exception(*sys.exc_info()))
if fd:
try:
@ -147,7 +147,7 @@ def log_output(session, path, args, outfile, uploadpath, cwd=None, logerror=0, a
else:
os.write(fd, msg)
os.close(fd)
except:
except BaseException:
pass
print(msg)
os._exit(1)
@ -166,7 +166,7 @@ def log_output(session, path, args, outfile, uploadpath, cwd=None, logerror=0, a
except IOError:
# will happen if the forked process has not created the logfile yet
continue
except:
except BaseException:
print('Error reading log file: %s' % outfile)
print(''.join(traceback.format_exception(*sys.exc_info())))
@ -1133,7 +1133,7 @@ class TaskManager(object):
try:
self.session.logoutChild(session_id)
del self.subsessions[task_id]
except:
except BaseException:
# not much we can do about it
pass
if wait:
@ -1233,7 +1233,7 @@ class TaskManager(object):
valid_host = handler.checkHost(self.hostdata)
except (SystemExit, KeyboardInterrupt):
raise
except:
except BaseException:
valid_host = False
self.logger.warn('Error during host check')
self.logger.warn(''.join(traceback.format_exception(*sys.exc_info())))
@ -1316,7 +1316,7 @@ class TaskManager(object):
# freeing this task will allow the pending restart to take effect
self.session.host.freeTasks([handler.id])
return
except:
except BaseException:
tb = ''.join(traceback.format_exception(*sys.exc_info()))
self.logger.warn("TRACEBACK: %s" % tb)
# report exception back to server