From e15e074266070c217e5da2e088ea6348536d2530 Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Thu, 24 Mar 2022 16:15:40 -0300 Subject: [PATCH] Re-enable frame eval mode by default. --- src/debugpy/_vendored/force_pydevd.py | 9 +-------- tests/debugpy/test_run.py | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/debugpy/_vendored/force_pydevd.py b/src/debugpy/_vendored/force_pydevd.py index 370348ac4..b7bc7469c 100644 --- a/src/debugpy/_vendored/force_pydevd.py +++ b/src/debugpy/_vendored/force_pydevd.py @@ -19,18 +19,11 @@ # raise ImportError(msg) warnings.warn(msg + ':\n {}'.format('\n '.join(_unvendored))) - # If debugpy logging is enabled, enable it for pydevd as well if "DEBUGPY_LOG_DIR" in os.environ: os.environ[str("PYDEVD_DEBUG")] = str("True") os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") -# Work around https://github.com/microsoft/debugpy/issues/346. -# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. -if "PYDEVD_USE_FRAME_EVAL" not in os.environ: - os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") - - # Constants must be set before importing any other pydevd module # # due to heavy use of "from" in them. with vendored('pydevd'): @@ -55,7 +48,7 @@ # When pydevd is imported it sets the breakpoint behavior, but it needs to be # overridden because by default pydevd will connect to the remote debugger using # its own custom protocol rather than DAP. -import pydevd # noqa +import pydevd # noqa import debugpy # noqa diff --git a/tests/debugpy/test_run.py b/tests/debugpy/test_run.py index 5d7bd8bbc..a74de69ba 100644 --- a/tests/debugpy/test_run.py +++ b/tests/debugpy/test_run.py @@ -327,7 +327,7 @@ def code_to_debug(): pass using_frame_eval = backchannel.receive() - assert using_frame_eval == (frame_eval == "yes") + assert using_frame_eval == (frame_eval in ("yes", "")) @pytest.mark.skipif(