Simplify a bunch of len(x) > 0/len(x) == 0 style expressions

This commit is contained in:
Aarni Koskela 2023-06-02 14:58:10 +03:00
parent 3e995778fc
commit 51864790fd
25 changed files with 47 additions and 48 deletions

View file

@ -287,14 +287,14 @@ def list_unets_callback():
def add_callback(callbacks, fun):
stack = [x for x in inspect.stack() if x.filename != __file__]
filename = stack[0].filename if len(stack) > 0 else 'unknown file'
filename = stack[0].filename if stack else 'unknown file'
callbacks.append(ScriptCallback(filename, fun))
def remove_current_script_callbacks():
stack = [x for x in inspect.stack() if x.filename != __file__]
filename = stack[0].filename if len(stack) > 0 else 'unknown file'
filename = stack[0].filename if stack else 'unknown file'
if filename == 'unknown file':
return
for callback_list in callback_map.values():