Skip to content

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

Merged
msfjarvis merged 1 commit into
ClangBuiltLinux:mainfrom
nathanchance:avoid-ruff-plw1509
Aug 18, 2023
Merged

boot-qemu.py: Workaround PLW1509 warning from Ruff#112
msfjarvis merged 1 commit into
ClangBuiltLinux:mainfrom
nathanchance:avoid-ruff-plw1509

Conversation

@nathanchance

Copy link
Copy Markdown
Member

This is the same warning from pylint that was disabled in ClangBuiltLinux/actions-workflows#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/

This is the same warning from pylint that was disabled in
ClangBuiltLinux/actions-workflows#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/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@msfjarvis msfjarvis merged commit a75b275 into ClangBuiltLinux:main Aug 18, 2023
@nathanchance nathanchance deleted the avoid-ruff-plw1509 branch August 21, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants