-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The code that checks whether a debugger is active has become outdated. Currently it only checks sys.gettrace(), but apparently python has introduced a new API for this. The correct code should now look like this (stolen from this StackOverflow answer):
import sys
def debug_enabled():
try:
if sys.gettrace() is not None:
return True
except AttributeError:
pass
try:
if sys.monitoring.get_tool(sys.monitoring.DEBUGGER_ID) is not None:
return True
except AttributeError:
pass
return FalseI would appreciate if this change could be added to version 7 of this plugin as well. I have quite a few projects that need to be tested with python 3.10, and v8+ all require at least python 3.11.
Metadata
Metadata
Assignees
Labels
No labels