diff --git a/plugins/org.python.pydev.core/pysrc/_pydevd_sys_monitoring/pydevd_sys_monitoring.py b/plugins/org.python.pydev.core/pysrc/_pydevd_sys_monitoring/pydevd_sys_monitoring.py index ad96e95593..1db2429bda 100644 --- a/plugins/org.python.pydev.core/pysrc/_pydevd_sys_monitoring/pydevd_sys_monitoring.py +++ b/plugins/org.python.pydev.core/pysrc/_pydevd_sys_monitoring/pydevd_sys_monitoring.py @@ -4,7 +4,6 @@ import re import sys import threading -import traceback from types import CodeType from typing import Dict, Optional, Set @@ -17,8 +16,9 @@ get_abs_path_real_path_and_base_from_file, \ get_abs_path_real_path_and_base_from_frame -DEBUGGER_ID = sys.monitoring.DEBUGGER_ID -monitor = sys.monitoring +if hasattr(sys, 'monitoring'): + DEBUGGER_ID = sys.monitoring.DEBUGGER_ID + monitor = sys.monitoring _thread_local_info = threading.local() _get_ident = threading.get_ident @@ -45,13 +45,6 @@ DEBUG_START_PY3K = ('_pydev_execfile.py', 'execfile') TRACE_PROPERTY = 'pydevd_traceproperty.py' -# Cache where we should keep that we completely skipped entering some context. -# It needs to be invalidated when: -# - Breakpoints are changed -# It can be used when running regularly (without step over/step in/step return) -global_cache_skips = {} -global_cache_frame_skips = {} - _global_notify_skipped_step_in = False _global_notify_skipped_step_in_lock = ForkSafeLock() diff --git a/plugins/org.python.pydev.core/pysrc/pydevd.py b/plugins/org.python.pydev.core/pysrc/pydevd.py index e44d6d7c62..e246e1a8dd 100644 --- a/plugins/org.python.pydev.core/pysrc/pydevd.py +++ b/plugins/org.python.pydev.core/pysrc/pydevd.py @@ -4,7 +4,6 @@ This module starts the debugger. ''' import sys # @NoMove -from _pydevd_sys_monitoring import pydevd_sys_monitoring if sys.version_info[:2] < (3, 6): raise RuntimeError('The PyDev.Debugger requires Python 3.6 onwards to be run. If you need to use an older Python version, use an older version of the debugger.') import os @@ -99,6 +98,9 @@ from _pydevd_bundle.pydevd_timeout import TimeoutTracker from _pydevd_bundle.pydevd_thread_lifecycle import suspend_all_threads, mark_thread_suspended +if USE_SYS_MONITORING: + from _pydevd_sys_monitoring import pydevd_sys_monitoring + pydevd_gevent_integration = None if SUPPORT_GEVENT: