diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py index bfe99165a..28fdd3738 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -14,8 +14,8 @@ from typing import Sequence from .bitcoin import COIN from .i18n import _ -from .util import PrintError, ThreadJob, make_dir, log_exceptions -from .util import make_aiohttp_session +from .util import (PrintError, ThreadJob, make_dir, log_exceptions, + make_aiohttp_session, resource_path) from .network import Network from .simple_config import SimpleConfig @@ -394,7 +394,7 @@ def dictinvert(d): return inv def get_exchanges_and_currencies(): - path = os.path.join(os.path.dirname(__file__), 'currencies.json') + path = resource_path('currencies.json') try: with open(path, 'r', encoding='utf-8') as f: return json.loads(f.read()) diff --git a/electrum/mnemonic.py b/electrum/mnemonic.py index 97889c0aa..5d5ac040f 100644 --- a/electrum/mnemonic.py +++ b/electrum/mnemonic.py @@ -30,7 +30,7 @@ import string import ecdsa -from .util import print_error +from .util import print_error, resource_path from .bitcoin import is_old_seed, is_new_seed from . import version @@ -88,7 +88,7 @@ def normalize_text(seed: str) -> str: return seed def load_wordlist(filename): - path = os.path.join(os.path.dirname(__file__), 'wordlist', filename) + path = resource_path('wordlist', filename) with open(path, 'r', encoding='utf-8') as f: s = f.read().strip() s = unicodedata.normalize('NFKD', s)