avocado/utils/process.py: Handle signal arguments by akihikodaki · Pull Request #5526 · avocado-framework/avocado · GitHub
Skip to content

avocado/utils/process.py: Handle signal arguments - #5526

Closed
akihikodaki wants to merge 1 commit into
avocado-framework:masterfrom
akihikodaki:master
Closed

akihikodaki wants to merge 1 commit into
avocado-framework:masterfrom
akihikodaki:master

Conversation

@akihikodaki

Copy link
Copy Markdown
Contributor

signal.default_int_handler needs the arguments to be passed on.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>

signal.default_int_handler needs the arguments to be passed on.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
@clebergnu

Copy link
Copy Markdown
Contributor

@akihikodaki

Copy link
Copy Markdown
Contributor Author

@clebergnu It looks like Python changed its behavior with version 3.10.0: python/cpython#21197

Finally, any reasons for actually maintaining the signum and frame argument names? I find that it's best for readability purposes, and there's no need for more than those two arguments.

You mean not maintaining them? I thought it clarifies Avocado does not care the arguments and it is just passing through. It will be also immune to an API change which adds a new argument to the signal handler. However, sometimes you may want to know the exact expected argument by looking at the header of signal_handler method as you say. It's matter of preference so I'll amend this change accordingly if you prefer maintaining them.

@clebergnu

Copy link
Copy Markdown
Contributor

@clebergnu It looks like Python changed its behavior with version 3.10.0: python/cpython#21197

Finally, any reasons for actually maintaining the signum and frame argument names? I find that it's best for readability purposes, and there's no need for more than those two arguments.

You mean not maintaining them? I thought it clarifies Avocado does not care the arguments and it is just passing through. It will be also immune to an API change which adds a new argument to the signal handler. However, sometimes you may want to know the exact expected argument by looking at the header of signal_handler method as you say. It's matter of preference so I'll amend this change accordingly if you prefer maintaining them.

Yes, I meant not maintaining them. But, I did not have the context about the change in function signature between versions (thanks for the explanation). In the end, because we need to support a wide range of Python versions, your original/current proposal is better indeed.

I'm trying to understand the CI failures with jobs getting stuck, though.

@clebergnu

Copy link
Copy Markdown
Contributor

@clebergnu clebergnu closed this Dec 2, 2022
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