-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-132950: Skip test_remote_pdb if remote exec is disabled #132951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't think this is the correct way to fix it. If remote debugging is not supported, this whole test file should be skipped. |
Do we have a flag somewhere about whether |
This change is a practical change for the current API. Currently, the only way to check if remote debugging is supported is to actually call Accepted https://peps.python.org/pep-0768/ only adds |
cc @pablogsal |
Currently maybe the only test that really uses Having a specific check in |
There is a macro to detect if remote_exec is supported. We can expose the macro somewhere (either the sys module or some other place). Ideas? |
Ah, I am forgetting I added this for this precise purpose:
|
It needs #132959 first |
If you dislike my approach, I suggest adding Checking if it's supported is non-trivial. Pseudo-code: int
_PySysRemoteDebug_Supported(void)
{
#if !defined(Py_SUPPORTS_REMOTE_DEBUG)
return 0;
#elif !defined(Py_REMOTE_DEBUG)
return 0;
#else
PyThreadState *tstate = _PyThreadState_GET();
const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp);
return (config->remote_debug == 1);
#endif
} |
We already have it: Lines 2433 to 2449 in 17718b0
|
55cd206
to
758e62f
Compare
Ok, I rewrote my PR to use |
Example:
|
@gaogaotiantian: Please review the updated PR. |
I still think we should skip the whole test file. Like I said, remote debugging does not exist if |
758e62f
to
939062f
Compare
Ok, I updated my PR to do that. Sorry, I don't know this code, so I tried to write the smallest change :-) |
It makes sense to start with the smallest change :) In this specific case I think skipping the file is the way to go. This looks good. |
Skip test_keyboard_interrupt() if remote execution is disabled.