Skip to content

Commit 99dd175

Browse files
committed
Give up with testing npm prefix on Windows.
1 parent 4780a39 commit 99dd175

File tree

1 file changed

+5
-4
lines changed
  • python_packages/jupyter_lsp/jupyter_lsp

1 file changed

+5
-4
lines changed

python_packages/jupyter_lsp/jupyter_lsp/types.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,7 @@ def _default_nodejs(self):
236236
def _npm_prefix(self):
237237
try:
238238
return (
239-
subprocess.run(
240-
["npm prefix -g"], check=True, capture_output=True, shell=True
241-
)
239+
subprocess.run(["npm", "prefix", "-g"], check=True, capture_output=True)
242240
.stdout.decode("utf-8")
243241
.strip()
244242
)
@@ -276,7 +274,10 @@ def _default_node_roots(self):
276274
if shutil.which("npm"):
277275
prefix = self._npm_prefix()
278276
if prefix:
279-
roots += [pathlib.Path(prefix) / "lib", pathlib.Path(prefix)]
277+
roots += [ # pragma: no cover
278+
pathlib.Path(prefix) / "lib",
279+
pathlib.Path(prefix),
280+
]
280281

281282
return roots
282283

0 commit comments

Comments
 (0)