Skip to content

Commit

Permalink
make path handling work across all Python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorrent committed Jun 9, 2024
1 parent d4a4d26 commit 055d1ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_utils/p2p_daemon.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import asyncio
import functools
import importlib.resources as pkg_resources
import os
import subprocess
import time
import uuid
from contextlib import asynccontextmanager, suppress
from pathlib import Path
from typing import NamedTuple

from multiaddr import Multiaddr, protocols
Expand All @@ -16,8 +16,9 @@

TIMEOUT_DURATION = 30 # seconds

with pkg_resources.path("hivemind", "hivemind_cli") as p2pd_path:
P2PD_PATH = os.path.join(str(p2pd_path), "p2pd")
hivemind_dir = Path(__file__).parent / "hivemind" / "hivemind_cli"

P2PD_PATH = str(hivemind_dir / "p2pd")


async def try_until_success(coro_func, timeout=TIMEOUT_DURATION):
Expand Down

0 comments on commit 055d1ce

Please sign in to comment.