• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-cli / 8393940571

22 Mar 2024 05:10PM UTC coverage: 95.613% (-0.05%) from 95.666%
8393940571

push

github

web-flow
Support Python 3.12 (#375)

* Support Python 3.12
* Stop supporting Python 3.8
* Only run linting for one Python version version

---------

Co-authored-by: Uxio Fuentefria <6909403+Uxio0@users.noreply.github.com>

2136 of 2234 relevant lines covered (95.61%)

3.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.83
/safe_cli/operators/hw_wallets/ledger_exceptions.py
1
import functools
4✔
2

3
from ledgereth.exceptions import (
4✔
4
    LedgerAppNotOpened,
5
    LedgerCancel,
6
    LedgerLocked,
7
    LedgerNotFound,
8
)
9

10
from ..exceptions import HardwareWalletException
4✔
11
from .exceptions import InvalidDerivationPath
4✔
12

13

14
def raise_ledger_exception_as_hw_wallet_exception(function):
4✔
15
    @functools.wraps(function)
4✔
16
    def wrapper(*args, **kwargs):
4✔
17
        try:
4✔
18
            return function(*args, **kwargs)
4✔
19
        except LedgerNotFound as e:
4✔
20
            raise HardwareWalletException(e.message)
4✔
21
        except LedgerLocked as e:
4✔
22
            raise HardwareWalletException(e.message)
4✔
23
        except LedgerAppNotOpened as e:
4✔
24
            raise HardwareWalletException(e.message)
4✔
25
        except LedgerCancel as e:
4✔
26
            raise HardwareWalletException(e.message)
4✔
27
        except InvalidDerivationPath as e:
4✔
28
            raise HardwareWalletException(e.message)
4✔
29
        except BaseException as e:
4✔
30
            if "Error while writing" in e.args:
4✔
31
                raise HardwareWalletException("Ledger error writting, restart safe-cli")
×
32
            raise e
4✔
33

34
    return wrapper
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc