diff --git a/ptvsd/wrapper.py b/ptvsd/wrapper.py index 86ef535c..080af26c 100644 --- a/ptvsd/wrapper.py +++ b/ptvsd/wrapper.py @@ -1397,13 +1397,13 @@ class VSCodeMessageProcessor(VSCLifecycleMsgProcessor): vendored_pydevd = os.path.sep + \ os.path.join('ptvsd', '_vendored', 'pydevd') ptvsd_path = os.path.sep + 'ptvsd' + site_path = os.path.sep + 'site-packages' project_dirs = [] for path in sys.path + [os.getcwd()]: is_stdlib = False norm_path = os.path.normcase(path) - if path.endswith(ptvsd_path) or \ - path.endswith(vendored_pydevd): + if path.endswith((ptvsd_path, vendored_pydevd, site_path)): is_stdlib = True else: for prefix in STDLIB_PATH_PREFIXES: @@ -2301,7 +2301,8 @@ class VSCodeMessageProcessor(VSCLifecycleMsgProcessor): xframe = xframes[0] filepath = unquote(xframe['file']) if reason in STEP_REASONS or reason in EXCEPTION_REASONS: - if not self._should_debug(filepath): + if self.internals_filter.is_internal_path(filepath) or \ + not self._should_debug(filepath): self.pydevd_notify(pydevd_comm.CMD_THREAD_RUN, pyd_tid) return diff --git a/tests/highlevel/__init__.py b/tests/highlevel/__init__.py index 2ae13a65..5263282a 100644 --- a/tests/highlevel/__init__.py +++ b/tests/highlevel/__init__.py @@ -908,7 +908,7 @@ class VSCTest(object): expected = list(self.vsc.protocol.parse_each(expected)) self.assertEqual(received[:-1], expected) - failure = received[-1] + failure = received[-1] if len(received) > 0 else [] expected = self.vsc.protocol.parse( self.fix.vsc_msgs.new_failure(req, failure.message)) self.assertEqual(failure, expected) diff --git a/tests/highlevel/test_lifecycle.py b/tests/highlevel/test_lifecycle.py index 1fc7f86d..e3b37960 100644 --- a/tests/highlevel/test_lifecycle.py +++ b/tests/highlevel/test_lifecycle.py @@ -30,13 +30,13 @@ def _get_project_dirs(): vendored_pydevd = os.path.sep + \ os.path.join('ptvsd', '_vendored', 'pydevd') ptvsd_path = os.path.sep + 'ptvsd' + site_path = os.path.sep + 'site-packages' project_dirs = [] for path in sys.path + [os.getcwd()]: is_stdlib = False norm_path = os.path.normcase(path) - if path.endswith(ptvsd_path) or \ - path.endswith(vendored_pydevd): + if path.endswith((ptvsd_path, vendored_pydevd, site_path)): is_stdlib = True else: for prefix in ptvsd.wrapper.STDLIB_PATH_PREFIXES: diff --git a/tests/system_tests/test_web_frameworks.py b/tests/system_tests/test_web_frameworks.py index afd68010..8c509a1f 100644 --- a/tests/system_tests/test_web_frameworks.py +++ b/tests/system_tests/test_web_frameworks.py @@ -378,7 +378,7 @@ class FlaskLaunchFileTests(WebFrameworkTests): 'FLASK_ENV': 'development', 'FLASK_DEBUG': '0', 'LC_ALL': 'C.UTF-8', - 'LANG': 'C.UTF-8' + 'LANG': 'C.UTF-8', }, cwd=cwd), framework='Jinja', @@ -399,7 +399,7 @@ class FlaskLaunchFileTests(WebFrameworkTests): 'FLASK_ENV': 'development', 'FLASK_DEBUG': '0', 'LC_ALL': 'C.UTF-8', - 'LANG': 'C.UTF-8' + 'LANG': 'C.UTF-8', }, cwd=cwd), framework='Jinja', @@ -418,7 +418,7 @@ class FlaskLaunchFileTests(WebFrameworkTests): 'FLASK_ENV': 'development', 'FLASK_DEBUG': '0', 'LC_ALL': 'C.UTF-8', - 'LANG': 'C.UTF-8' + 'LANG': 'C.UTF-8', }, cwd=cwd), 'Jinja', filename) @@ -434,7 +434,7 @@ class FlaskLaunchFileTests(WebFrameworkTests): 'FLASK_ENV': 'development', 'FLASK_DEBUG': '0', 'LC_ALL': 'C.UTF-8', - 'LANG': 'C.UTF-8' + 'LANG': 'C.UTF-8', }, cwd=cwd), 'Jinja', filename)