Skip to content

Commit

Permalink
Better handle incorrect file path for wallets. (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
thewhaleking authored Nov 8, 2024
1 parent 66d14ad commit 253d686
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions bittensor_cli/src/bittensor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,14 @@ def get_hotkey_wallets_for_wallet(
def get_coldkey_wallets_for_path(path: str) -> list[Wallet]:
"""Gets all wallets with coldkeys from a given path"""
wallet_path = Path(path).expanduser()
wallets = [
Wallet(name=directory.name, path=path)
for directory in wallet_path.iterdir()
if directory.is_dir()
]
try:
wallets = [
Wallet(name=directory.name, path=path)
for directory in wallet_path.iterdir()
if directory.is_dir()
]
except FileNotFoundError:
wallets = []
return wallets


Expand Down

0 comments on commit 253d686

Please sign in to comment.