From 3e90c5a90325f1f832b3e80fa2dc44c787676ef7 Mon Sep 17 00:00:00 2001 From: Duprat Date: Wed, 18 May 2022 11:42:51 +0200 Subject: [PATCH] Update handlers.py Add "-X=frozen_modules=off" to cpython interpreter when version==3.11 --- src/debugpy/launcher/handlers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/debugpy/launcher/handlers.py b/src/debugpy/launcher/handlers.py index 48010521..c4fbd38a 100644 --- a/src/debugpy/launcher/handlers.py +++ b/src/debugpy/launcher/handlers.py @@ -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 += [