Skip to content

Commit

Permalink
🐛 Fix LSP printers devnull fd kept open
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed May 22, 2024
1 parent 411351b commit 696f467
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions wake/lsp/lsp_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,22 +1161,23 @@ async def __run_printers(self) -> None:
logging_buffer = []
logging_handler = LspLoggingHandler(logging_buffer)

console = Console(file=open(os.devnull, "w"))

_, printer_exceptions = run_printers(
all_printers,
self.last_build,
self.last_build_info,
self.__last_graph,
self.__config,
console,
None,
self.__printers_lsp_provider,
verify_paths=False,
capture_exceptions=True,
logging_handler=logging_handler,
extra={"lsp": True},
)
with open(os.devnull, "w") as devnull:
console = Console(file=devnull)

_, printer_exceptions = run_printers(
all_printers,
self.last_build,
self.last_build_info,
self.__last_graph,
self.__config,
console,
None,
self.__printers_lsp_provider,
verify_paths=False,
capture_exceptions=True,
logging_handler=logging_handler,
extra={"lsp": True},
)
exceptions = {name: repr(e) for name, e in printer_exceptions.items()}

for log, log_type in logging_buffer:
Expand Down

0 comments on commit 696f467

Please sign in to comment.