Skip to content

Commit 3c45bdf

Browse files
authored
fix: disable gevent in debug mode for better compatibility with JetBrains Python debugger (#12299)
Signed-off-by: -LAN- <[email protected]>
1 parent c135967 commit 3c45bdf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/app.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ def is_db_command():
1414

1515
app = create_migrations_app()
1616
else:
17-
if os.environ.get("FLASK_DEBUG", "False") != "True":
17+
# It seems that JetBrains Python debugger does not work well with gevent,
18+
# so we need to disable gevent in debug mode.
19+
# If you are using debugpy and set GEVENT_SUPPORT=True, you can debug with gevent.
20+
if (flask_debug := os.environ.get("FLASK_DEBUG", "0")) and flask_debug.lower() not in {"false", "0", "no"}:
1821
from gevent import monkey # type: ignore
1922

2023
# gevent

0 commit comments

Comments
 (0)