File tree Expand file tree Collapse file tree 7 files changed +34
-10
lines changed
src/test/pythonFiles/folding Expand file tree Collapse file tree 7 files changed +34
-10
lines changed Original file line number Diff line number Diff line change 1919 sys .path .insert (0 , ptvs_lib_path )
2020 try :
2121 import ptvsd
22- import ptvsd .debugger as vspd
2322 from ptvsd .__main__ import main
2423 ptvsd_loaded = True
2524 except ImportError :
2625 ptvsd_loaded = False
2726 raise
28- vspd .DONT_DEBUG .append (os .path .normcase (__file__ ))
2927except :
3028 traceback .print_exc ()
3129 print ('''
Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ def exclude_current_file_from_debugger():
2020 # Load the debugger package
2121 try :
2222 import ptvsd
23- import ptvsd .debugger as vspd
24- vspd .DONT_DEBUG .append (os .path .normcase (__file__ ))
2523 except :
2624 traceback .print_exc ()
2725 print ('''
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ def main():
222222 (opts , _ ) = parser .parse_args ()
223223
224224 if opts .debug :
225- from ptvsd .visualstudio_py_debugger import DONT_DEBUG , DEBUG_ENTRYPOINTS , get_code
225+ from ptvsd .visualstudio_py_debugger import DEBUG_ENTRYPOINTS , get_code
226226
227227 sys .path [0 ] = os .getcwd ()
228228 if opts .result_port :
@@ -238,7 +238,7 @@ def main():
238238 sys .stderr = _TestOutput (sys .stderr , is_stdout = False )
239239
240240 if opts .debug :
241- DONT_DEBUG . append ( os . path . normcase ( __file__ ) )
241+ # TODO: Stop using this internal API? (See #3201. )
242242 DEBUG_ENTRYPOINTS .add (get_code (main ))
243243
244244 pass
Original file line number Diff line number Diff line change 8383ATCH = to_bytes ('ATCH' )
8484REPL = to_bytes ('REPL' )
8585
86+ PY_ROOT = os .path .normcase (__file__ )
87+ while os .path .basename (PY_ROOT ) != 'pythonFiles' :
88+ PY_ROOT = os .path .dirname (PY_ROOT )
89+
8690_attach_enabled = False
8791_attached = threading .Event ()
88- vspd .DONT_DEBUG .append (os .path .normcase (__file__ ))
8992
9093
9194class AttachAlreadyEnabledError (Exception ):
@@ -238,6 +241,10 @@ def server_thread_func():
238241
239242 elif response == ATCH :
240243 debug_options = vspd .parse_debug_options (read_string (client ))
244+ debug_options .setdefault ('rules' , []).append ({
245+ 'path' : PY_ROOT ,
246+ 'include' : False ,
247+ })
241248 if redirect_output :
242249 debug_options .add ('RedirectOutput' )
243250
Original file line number Diff line number Diff line change 3535ATCH = to_bytes ('ATCH' )
3636REPL = to_bytes ('REPL' )
3737
38+ PY_ROOT = os .path .normcase (__file__ )
39+ while os .path .basename (PY_ROOT ) != 'pythonFiles' :
40+ PY_ROOT = os .path .dirname (PY_ROOT )
41+
3842_attach_enabled = False
3943_attached = threading .Event ()
40- vspd .DONT_DEBUG .append (os .path .normcase (__file__ ))
4144
4245
4346class AttachAlreadyEnabledError (Exception ):
@@ -187,6 +190,10 @@ def server_thread_func():
187190
188191 elif response == ATCH :
189192 debug_options = vspd .parse_debug_options (read_string (client ))
193+ debug_options .setdefault ('rules' , []).append ({
194+ 'path' : PY_ROOT ,
195+ 'include' : False ,
196+ })
190197 if redirect_output :
191198 debug_options .add ('RedirectOutput' )
192199
Original file line number Diff line number Diff line change 8383ATCH = to_bytes ('ATCH' )
8484REPL = to_bytes ('REPL' )
8585
86+ PY_ROOT = os .path .normcase (__file__ )
87+ while os .path .basename (PY_ROOT ) != 'pythonFiles' :
88+ PY_ROOT = os .path .dirname (PY_ROOT )
89+
8690_attach_enabled = False
8791_attached = threading .Event ()
88- vspd .DONT_DEBUG .append (os .path .normcase (__file__ ))
8992
9093
9194class AttachAlreadyEnabledError (Exception ):
@@ -187,6 +190,10 @@ def server_thread_func():
187190
188191 elif response == ATCH :
189192 debug_options = vspd .parse_debug_options (read_string (client ))
193+ debug_options .setdefault ('rules' , []).append ({
194+ 'path' : PY_ROOT ,
195+ 'include' : False ,
196+ })
190197 if redirect_output :
191198 debug_options .add ('RedirectOutput' )
192199
Original file line number Diff line number Diff line change 7171
7272DEBUG = os .environ .get ('DEBUG_REPL' ) is not None
7373
74+ PY_ROOT = os .path .normcase (__file__ )
75+ while os .path .basename (PY_ROOT ) != 'pythonFiles' :
76+ PY_ROOT = os .path .dirname (PY_ROOT )
77+
7478__all__ = ['ReplBackend' , 'BasicReplBackend' , 'BACKEND' ]
7579
7680def _debug_write (out ):
@@ -349,6 +353,10 @@ def _cmd_debug_attach(self):
349353 port = read_int (self .conn )
350354 id = read_string (self .conn )
351355 debug_options = visualstudio_py_debugger .parse_debug_options (read_string (self .conn ))
356+ debug_options .setdefault ('rules' , []).append ({
357+ 'path' : PY_ROOT ,
358+ 'include' : False ,
359+ })
352360 self .attach_process (port , id , debug_options )
353361
354362 _COMMANDS = {
@@ -380,7 +388,6 @@ def init_debugger(self):
380388 from os import path
381389 sys .path .append (path .dirname (__file__ ))
382390 import visualstudio_py_debugger
383- visualstudio_py_debugger .DONT_DEBUG .append (path .normcase (__file__ ))
384391 new_thread = visualstudio_py_debugger .new_thread ()
385392 sys .settrace (new_thread .trace_func )
386393 visualstudio_py_debugger .intercept_threads (True )
You can’t perform that action at this time.
0 commit comments