Update handlers.py

Add "-X=frozen_modules=off" to cpython interpreter when version==3.11
This commit is contained in:
Duprat 2022-05-18 11:42:51 +02:00 committed by Pavel Minaev
parent 78b030f509
commit 3e90c5a903

View file

@ -10,6 +10,8 @@ from debugpy import launcher
from debugpy.common import json
from debugpy.launcher import debuggee
# see https://github.com/microsoft/debugpy/issues/861
PYTHON_311 = sys.version_info[:2] == (3, 11)
def launch_request(request):
debug_options = set(request("debugOptions", json.array(str)))
@ -38,6 +40,10 @@ def launch_request(request):
python = request("python", json.array(str, size=(1,)))
cmdline = list(python)
# see https://github.com/microsoft/debugpy/issues/861
if PYTHON_311:
cmdline += ["-X", "frozen_modules=off"]
if not request("noDebug", json.default(False)):
port = request("port", int)
cmdline += [