Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject
Expand Down
9 changes: 8 additions & 1 deletion pylsp/plugins/flake8_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
| {"E999"}
)

if sys.platform == "win32":
from subprocess import CREATE_NO_WINDOW
else:
# CREATE_NO_WINDOW flag only available on Windows.
# Set constant as default `Popen` `creationflag` kwarg value (`0`)
CREATE_NO_WINDOW = 0


@hookimpl
def pylsp_settings():
Expand Down Expand Up @@ -128,7 +135,7 @@ def run_flake8(flake8_executable, args, document, source):
)

log.debug("Calling %s with args: '%s'", flake8_executable, args)
popen_kwargs = {}
popen_kwargs = {"creationflags": CREATE_NO_WINDOW}
if cwd := document._workspace.root_path:
popen_kwargs["cwd"] = cwd
try:
Expand Down