ClangBuiltLinux / boot-utils

Collection of files for booting Linux kernels
26 stars 7 forks source link

boot-qemu.py: Workaround PLW1509 warning from Ruff #112

Closed nathanchance closed 1 year ago

nathanchance commented 1 year ago

This is the same warning from pylint that was disabled in https://github.com/ClangBuiltLinux/actions-workflows/pull/5.

boot-qemu.py:216:35: PLW1509 `preexec_fn` argument is unsafe when using threads

preexec_fn is on the path towards deprecation, so workaround this warning by refactoring the code to use the new keyword argument process_group when using Python 3.11 and newer, which makes it clear that we don't need preexec_fn longterm. This conveniently hides the preexec_fn use in Popen() so there is no more warning.

Link: https://beta.ruff.rs/docs/rules/subprocess-popen-preexec-fn/