Skip to content

Commit 8f9623e

Browse files
author
Roman
committed
fix async instance initialize
1 parent 23a862f commit 8f9623e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bittensor/core/subtensor_api/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,14 @@ def __init__(
9494
def _get_subtensor(self) -> Union["_Subtensor", "_AsyncSubtensor"]:
9595
"""Returns the subtensor instance based on the provided config and subtensor type flag."""
9696
if self.is_async:
97-
self.initialize = self._subtensor.initialize
98-
return _AsyncSubtensor(
97+
_subtensor = _AsyncSubtensor(
9998
network=self.network,
10099
config=self._config,
101100
_mock=self._mock,
102101
log_verbose=self.log_verbose,
103102
)
103+
self.initialize = _subtensor.initialize
104+
return _subtensor
104105
else:
105106
return _Subtensor(
106107
network=self.network,

0 commit comments

Comments
 (0)