Skip to content

Commit ee9f358

Browse files
committed
fix #543
1 parent 5d8f81a commit ee9f358

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pythonFiles/PythonTools/visualstudio_py_testlauncher.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ def main():
213213
parser.add_option('--uf', '--failfast', type='str', help='Stop on first failure')
214214
parser.add_option('--uc', '--catch', type='str', help='Catch control-C and display results')
215215
(opts, _) = parser.parse_args()
216+
217+
if opts.secret and opts.port:
218+
from ptvsd.visualstudio_py_debugger import DONT_DEBUG, DEBUG_ENTRYPOINTS, get_code
219+
from ptvsd.attach_server import DEFAULT_PORT, enable_attach, wait_for_attach
216220

217221
sys.path[0] = os.getcwd()
218222
if opts.result_port:
@@ -228,9 +232,6 @@ def main():
228232
sys.stderr = _TestOutput(sys.stderr, is_stdout = False)
229233

230234
if opts.secret and opts.port:
231-
from ptvsd.visualstudio_py_debugger import DONT_DEBUG, DEBUG_ENTRYPOINTS, get_code
232-
from ptvsd.attach_server import DEFAULT_PORT, enable_attach, wait_for_attach
233-
234235
DONT_DEBUG.append(os.path.normcase(__file__))
235236
DEBUG_ENTRYPOINTS.add(get_code(main))
236237

0 commit comments

Comments
 (0)