debugpy/tests/test_data/flask1/main.py
Pavel Minaev 55eac82c96 Fix #1811: tests using attach_by_pid fail on Python 2.7
Don't call enable_attach() and wait_for_attach() while under import lock.
2020-01-26 17:14:30 -08:00

9 lines
308 B
Python

# For multiproc attach, we need to use a helper stub to import debuggee before running
# Flask; otherwise, we will get the connection only from the subprocess, not from the
# Flask server process.
import debuggee
import runpy
debuggee.setup()
runpy.run_module("flask", run_name="__main__", alter_sys=True)