feat: Matching go-libp2p PeerStore implementation

This commit is contained in:
lla-dane
2025-06-01 23:02:41 +05:30
parent e6f96d32e2
commit f3d8cbf968
5 changed files with 535 additions and 225 deletions

View File

@ -18,7 +18,6 @@ import sys
from typing import (
Any,
TypeVar,
cast,
)
import uuid
@ -361,7 +360,7 @@ class BaseManager(InternalManagerAPI):
# Only show stacktrace if this is **not** a DaemonTaskExit error
exc_info=not isinstance(err, DaemonTaskExit),
)
self._errors.append(cast(EXC_INFO, sys.exc_info()))
self._errors.append(sys.exc_info())
self.cancel()
else:
if task.parent is None:

View File

@ -52,7 +52,6 @@ from .exceptions import (
LifecycleError,
)
from .typing import (
EXC_INFO,
AsyncFn,
)
@ -232,7 +231,7 @@ class TrioManager(BaseManager):
# Exceptions from any tasks spawned by our service will be
# caught by trio and raised here, so we store them to report
# together with any others we have already captured.
self._errors.append(cast(EXC_INFO, sys.exc_info()))
self._errors.append(sys.exc_info())
finally:
system_nursery.cancel_scope.cancel()