replace hasattr with getattr for cleaner code
This commit is contained in:
parent
04d7bb6265
commit
7a50f6ac25
1 changed files with 2 additions and 2 deletions
|
@ -22,8 +22,8 @@ class BackgroundTask:
|
|||
result = self.task(*self.args)
|
||||
logging.info("task completed")
|
||||
# if start session fails, a response with Result: False and a list of exceptions is returned
|
||||
if hasattr(result, "result") and not result.result:
|
||||
if hasattr(result, "exceptions") and len(result.exceptions) > 0:
|
||||
if not getattr(result, "result", True):
|
||||
if len(getattr(result, "exceptions", [])) > 0:
|
||||
self.master.after(
|
||||
0,
|
||||
show_grpc_response_exceptions,
|
||||
|
|
Loading…
Reference in a new issue