mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-18 02:35:23 -04:00
fix: fall back for npx cache subprocess check (#3560)
Co-authored-by: Alexandre Teixeira <111787685+alteixeira20@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,7 @@ Each server runs as a stdio subprocess managed by McpManager.
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import asyncio
|
||||
|
||||
@@ -208,6 +209,16 @@ async def _is_npx_package_cached(npx_path, package_spec, timeout_s=5):
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
)
|
||||
except NotImplementedError:
|
||||
try:
|
||||
result = subprocess.run(
|
||||
[npx_path, "--no-install", package_spec, "--version"],
|
||||
capture_output=True,
|
||||
timeout=timeout_s,
|
||||
)
|
||||
except (subprocess.TimeoutExpired, OSError, ValueError):
|
||||
return False
|
||||
return result.returncode == 0 and bool(result.stdout.strip())
|
||||
except (OSError, ValueError):
|
||||
return False
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user