BLE001: fix

This commit is contained in:
Jörg Thalheim
2025-08-20 17:13:38 +02:00
parent c55b369899
commit c9a709783a
16 changed files with 49 additions and 63 deletions

View File

@@ -84,7 +84,7 @@ def _init_proc(
print(linebreak + f" {func.__name__}:{pid} " + linebreak, file=sys.stderr)
try:
func(**kwargs)
except Exception as ex:
except Exception as ex: # noqa: BLE001
traceback.print_exc()
if on_except is not None:
on_except(ex, mp.current_process())

View File

@@ -345,7 +345,7 @@ class VMObject(GObject.Object):
raise ClanError(msg)
with self.qmp_wrap.qmp_ctx() as qmp:
qmp.command("system_powerdown")
except Exception as ex:
except (ClanError, OSError, ConnectionError) as ex:
log.debug(f"QMP command 'system_powerdown' ignored. Error: {ex}")
# Try 20 times to stop the VM

View File

@@ -139,7 +139,7 @@ class ClanStore:
# Convert the byte array to a string and print it
logs_view.set_message(contents.decode("utf-8"))
except Exception as e:
except (GLib.Error, UnicodeDecodeError) as e:
print(f"Error reading file: {e}")
# only one vm can output logs at a time