From 6e3c457f4393c693a82d84c3206284ce5053869d Mon Sep 17 00:00:00 2001 From: gaborbernat Date: Thu, 24 Dec 2020 15:47:11 +0300 Subject: [PATCH] PY-45659 Python isolated mode (-I) breaks subprocess debugging (pr #1488) Signed-off-by: Elizaveta Shashkova IDEA-CR-69971 GitOrigin-RevId: 9db39b45fe40dd7d60af38c49d9cbb76870ac7f6 --- python/helpers/pydev/pydevd.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/helpers/pydev/pydevd.py b/python/helpers/pydev/pydevd.py index 13541bcba9dd..dd1eb3d125c4 100644 --- a/python/helpers/pydev/pydevd.py +++ b/python/helpers/pydev/pydevd.py @@ -3,10 +3,16 @@ Entry point module (keep at root): This module starts the debugger. ''' +import os import sys from contextlib import contextmanager import weakref +# allow the debugger to work in isolated mode Python +here = os.path.dirname(os.path.abspath(__file__)) +if here not in sys.path: + sys.path.insert(0, here) + from _pydevd_bundle.pydevd_collect_try_except_info import collect_return_info if sys.version_info[:2] < (2, 6):