Skip to content

Commit 672b4fc

Browse files
committed
chore: use "spawn" as multiprocess context on all plattforms
1 parent c36683e commit 672b4fc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

robotcode/language_server/robotframework/diagnostics/imports_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import ast
44
import asyncio
55
import itertools
6+
import multiprocessing as mp
67
import os
78
import shutil
89
import sys
@@ -1011,7 +1012,7 @@ async def _get_libdoc(name: str, args: Tuple[Any, ...], working_dir: str, base_d
10111012
except BaseException as e:
10121013
self._logger.exception(e)
10131014

1014-
with ProcessPoolExecutor(max_workers=1) as executor:
1015+
with ProcessPoolExecutor(max_workers=1, mp_context=mp.get_context("spawn")) as executor:
10151016
result = await asyncio.wait_for(
10161017
asyncio.get_running_loop().run_in_executor(
10171018
executor,
@@ -1253,7 +1254,7 @@ async def _get_libdoc() -> VariablesDoc:
12531254
except BaseException as e:
12541255
self._logger.exception(e)
12551256

1256-
with ProcessPoolExecutor(max_workers=1) as executor:
1257+
with ProcessPoolExecutor(max_workers=1, mp_context=mp.get_context("spawn")) as executor:
12571258
result = await asyncio.wait_for(
12581259
asyncio.get_running_loop().run_in_executor(
12591260
executor,

robotcode/language_server/robotframework/parts/code_action_documentation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import contextlib
4+
import multiprocessing as mp
45
import socket
56
import threading
67
import traceback
@@ -131,7 +132,7 @@ def calc_md() -> str:
131132

132133
self.wfile.write(bytes(data, "utf-8"))
133134
else:
134-
with ProcessPoolExecutor(max_workers=1) as executor:
135+
with ProcessPoolExecutor(max_workers=1, mp_context=mp.get_context("spawn")) as executor:
135136
result = executor.submit(
136137
get_robot_library_html_doc_str,
137138
name,

0 commit comments

Comments
 (0)